Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module started out working fine for several weeks before the Google results stopped showing.
I updated to the newest dev version and it still didn't show the issue.
I uninstalled/reinstalled the module but that did not fix the problem.
Before the uninstall the graph would show what looked like accurate Google stats but it wouldn't display them in the table.
Please see the attached screenshot.
Comment | File | Size | Author |
---|---|---|---|
google-results-blank.jpg | 45.5 KB | onetwoten |
Comments
Comment #1
Vithar CreditAttribution: Vithar commentedMy SEO Watcher does this exact same thing, I'm using Drupal 7 and SEO Watcher 7.x-1.0-beta1
Comment #2
xxmuaddib CreditAttribution: xxmuaddib commentedThe same here...
Comment #3
mikeinvaldosta CreditAttribution: mikeinvaldosta commentedWorking perfectly for Yahoo. No results for Google.
Comment #4
jefflinwood CreditAttribution: jefflinwood commentedCan you make a search request to google from the server that hosts your Drupal site?
It's not well explained on this module's page, but Google can and will ban your IP if it thinks you are sending automated search requests - which is exactly what this module does.
You'll probably see a "Google thinks you are a computer sending automated queries" or something similar if you make a request to Google from this IP.
Comment #5
mikeinvaldosta CreditAttribution: mikeinvaldosta commentedI cannot, however, the module never produced any google results. Your point is still valid.
Oh well.
Comment #6
paulhudson CreditAttribution: paulhudson commentedResult from SEO Watcher:
result from Firefox when signed in:
Result from Firefox when not signed in:
I think the regex needs to be changed in the seowatcher_get_ranking() function.
Old regex:
New regex:
Could you test and let me know how you get on. :-)
Comment #7
dmiric CreditAttribution: dmiric commentedthat solution dosent work for me
Comment #8
paulhudson CreditAttribution: paulhudson commentedHi dmiric,
I have a site that tracks a few domains with the above code and it's working ok.
It makes me think your IP might be banned by Google?
Could you add watchdog('seo watcher', print_r($result, true)); after the drupal_http_request around line 1220 of seowatcher.module?
If you could send an example of the output that Google returns I should be able to look at it for you.
Are you looking for google.com or google.co.uk results pages?
Best, Paul
Comment #9
bsztreha CreditAttribution: bsztreha commentedI have the same problem :(
Comment #10
DigitalFrontiersMediaI believe that Google (and possibly some of the other providers) have changed their formats, thereby making the currently used regex useless.
I just tried this module fresh out of the box in both D6 & D7 sites on two different servers (one being a dedicated virtual server with only a single web account on it, a dedicated static IP, and never having run any Google SEO queries from it before) and it failed to produce results on either no matter what kind of settings I provided.
I finally put in a watchdog statement to see what the $link variable was that was being churned on in seowatcher_get_ranking() and saw that the regex is returning only "/url" for Google matches in the function to compare against the site's url--obviously not a match.
I suck at regex, but was able to fiddle with it enough to get it to provide the part of the expression following /url? in the Google matches such that it looked similar to this instead of simply "/url":
q=http://plusonehealthmanagement.com/content/case-studies-corporate-fitnes..."
This at least provides the domain name in the Google match from which the SEO Watcher module can then do the match comparison and provide the SERP rank count. This was accomplished by changing the regex for Google from:
to
This is not ideal at all, however, and needs someone with far better regex skills than I to make this right. Without the regexs working properly, this module is useless, so marking this as a major bug.
Comment #11
paulhudson CreditAttribution: paulhudson commentedHey DigitalFrontiersMedia,
You read my mind... here's the regex I'm using:
preg_match_all('/ class="r"><a.*?href="\/url\?q=([^"\?]+?)["\?].*?>/', $html, $links);
Best,
Paul