php file_get_contents() usage

Popular automatic website translation tool

php file_get_contents() usage

Postby casinobonus » Thu Apr 10, 2014 11:17 pm

Hi.

I think this issue is related to a old one posted, but I will try to explain from the beginning.

I need to use the following code in a page on my main (no-translated) domain casinobonuscenter.com:

<?php
$desc_esp = file_get_contents("http://es.casinobonuscenter.com/dsctranslate.php?linkid=44");
echo $desc_esp;
?>

to read and show some content from a translated page (served by gtranslate).

This code is yet on the following url: http://casinobonuscenter.com/traduc-cron/getfile.php

As you can see, I can't read the content of the translated page. My hosting provider is telling me as follow:

====Start quote
http://casinobonuscenter.com/traduc-cron/getfile.php is not accessible from your VPS because they have firewall, blocking the connection:

bash-4.1# wget http://es.casinobonuscenter.com/dsctran ... ?linkid=44
--2014-04-10 16:36:23-- http://es.casinobonuscenter.com/dsctran ... ?linkid=44
Resolving es.casinobonuscenter.com... 94.23.220.123
Connecting to es.casinobonuscenter.com|94.23.220.123|:80... failed: Connection timed out.
Retrying.

bash-4.1# traceroute -n 94.23.220.123
traceroute to 94.23.220.123 (94.23.220.123), 30 hops max, 60 byte packets
1 46.249.204.186 0.090 ms 0.009 ms 0.008 ms
2 193.29.223.69 1.367 ms 1.537 ms 1.636 ms
3 141.136.98.21 1.088 ms 1.103 ms 1.098 ms
4 141.136.99.74 1.090 ms 1.070 ms 1.069 ms
5 * * *
6 94.23.122.66 5.745 ms 5.889 ms 5.949 ms
7 94.23.122.173 5.346 ms * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
====End quote

So, basically he is directing me to the same point explained on my old topic on this forum.

I know you don't have firewalls or blocking the IP, but do you have a possible solution or suggestion?
casinobonus
 
Posts: 66
Joined: Sun Jun 24, 2012 7:28 pm

Re: php file_get_contents() usage

Postby Edvard » Fri Apr 11, 2014 4:32 pm

Hi,

I would suggest to place your script on a different server and modify your current script to call the script on the other server which will get the needed data.

If your purpose is to setup a cron script which will access translated pages to make the translation process faster, then just set it up on a different server.

Also, make sure that you won't send too many requests to our server and overload it if you don't want to get blocked by our system.

Thanks!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: php file_get_contents() usage

Postby casinobonus » Fri Apr 11, 2014 5:14 pm

Thank you.

Yes, I like to use cron to access some translated text faster.

I will use this for about 400 pages (text only) all similar to this one: http://es.casinobonuscenter.com/dsctran ... ?linkid=35 and for 4 languages, so I will request about 1600 pages. But this will be only once because after that I will check every 12 hours and I will request only modified pages...
casinobonus
 
Posts: 66
Joined: Sun Jun 24, 2012 7:28 pm

Re: php file_get_contents() usage

Postby Edvard » Fri Apr 11, 2014 5:28 pm

You need to make sure that you do less than 10 requests per second.

Thanks!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest

2GLux