safikul / seostats

Automatically exported from code.google.com/p/seostats
0 stars 0 forks source link

Google_Backlinks_Total called from code give different result than demo page #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It seems that my PHP code returns the correct value the first time, but after 
executing that same code multiple times within an hour, I get only zeroes now. 
Is there some kind of time limit?

To reproduce, use the following code and execute it a few times:
<?php ini_set('max_execution_time', 180);

include '../src/class.seostats.php';
try 
{
    $url = new SEOstats("http://www.fetedelapeche.gouv.qc.ca/");
    $r = $url->Google_Backlinks_Total();
    echo '<pre>';
    echo ( $r );
    echo '</pre>';
} 
catch (SEOstatsException $e) 
{
    die($e->getMessage());
}
?>

At some point (sorry, can't say when exactly) the output will be and stay zero 
(0) for subsequent attempts.

However, using the online demo produces the correct result (16):
http://api.nahklick.de/seo/index.php?method=Google_Backlinks_Total&url=http://ww
w.fetedelapeche.gouv.qc.ca/

PHP Version 5.2.6-3ubuntu4.6
Server: Linux 2.6.28-19-generic #66-Ubuntu SMP Sat Oct 16 17:39:04 UTC 2010 
i686 

Original issue reported on code.google.com by oscarham...@gmail.com on 29 Mar 2011 at 6:19

GoogleCodeExporter commented 9 years ago
ADDITIONAL INFO
It seems that this happens when I'm processing a batch of links. I have around 
500 links I want to check but after the 224th, all the rest report zero. So 
again, this may be some kind of limit I'm not aware of. 

Original comment by oscarham...@gmail.com on 30 Mar 2011 at 2:06

GoogleCodeExporter commented 9 years ago
Your demo link also returns a zero right now. One reason might be that the 
results vary, depending on the G data center the class is requesting.

Your second post covers another point. Requesting a bunch of URLs at once will 
cause a temporary block by G. You can prevent this by adding a sleep to your 
foreach loop. I will add this to the class with the next release.

I will close that bug report and file a new one for your second post.

Original comment by eyecatchup@gmail.com on 6 Apr 2011 at 4:09