eyecatchup/SEOstats

Results are not being fetched in get-google-serps.php (Probably google blocking the script)

rizwan95 opened this issue · 6 comments

Hello,

The library works fine for everything excpet get-google-serps.php

The results are not being fetched and hence no data are being shown. And I tried to test the code and I put the following code
echo $info['http_code'];
echo $result;
return ($info['http_code']!=200) ? false : $result;

in gcurl function in Services.php and I got the result as 302 permanently moved.

I think google is blocking the serp script.

Probably your IP has been blocked by the Google due to number of the request you've sent to their API! You need to use proxies when sending lots of request back to back to a website like Google.

How do I do that ?

Dig into the method do the call. I checked it while back and it was sending the request via CURL. You need to add CURLOPT_PROXY in your options and define your proxies. However, you need to come up with a solution to rotate the proxies otherwise that one will be blocked too.
More info about CURL options at http://php.net/manual/en/function.curl-setopt.php

Thank you so much for the solution will try it and get back to you.

tholu commented

See also my current pull request: #129 - this should also fix this issue here.