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.

CommentFileSizeAuthor
google-results-blank.jpg45.5 KBonetwoten
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Vithar’s picture

My SEO Watcher does this exact same thing, I'm using Drupal 7 and SEO Watcher 7.x-1.0-beta1

xxmuaddib’s picture

Version: 6.x-1.x-dev » 7.x-1.0-beta1

The same here...

mikeinvaldosta’s picture

Working perfectly for Yahoo. No results for Google.

jefflinwood’s picture

Can 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.

mikeinvaldosta’s picture

I cannot, however, the module never produced any google results. Your point is still valid.

Oh well.

paulhudson’s picture

Status: Active » Needs review

Result from SEO Watcher:

<h3 class="r">
<a onmousedown="return hlprwt(this, 'http://www.example.com/')" href="http://www.example.com/">
<b>Skate Shop</b>

result from Firefox when signed in:

<h3 class="r">
<a class="l" onmousedown="return rwt(this,'','','','47','AFQjCNFEw6BCqVtRbF1Zbi-KeNbx8OxS8A','','0CIsBEBYwBjgo')" href="http://www.example.com/">

Result from Firefox when not signed in:

<h3 class="r">
<a class="l" onmousedown="return rwt(this,'','','','47','AFQjCNFEw6BCqVtRbF1Zbi-KeNbx8OxS8A','','0CGUQFjAGOCg')" href="http://www.example.com/">

I think the regex needs to be changed in the seowatcher_get_ranking() function.

Old regex:

preg_match_all('/ class="r"><a href="([^"\?]+?)["\?].*?class=l.*?>/', $html, $links);

New regex:

preg_match_all('/ class="r"><a.*?href="([^"\?]+?)["\?].*?>/', $html, $links);

Could you test and let me know how you get on. :-)

dmiric’s picture

that solution dosent work for me

paulhudson’s picture

Hi 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

bsztreha’s picture

I have the same problem :(

DigitalFrontiersMedia’s picture

Version: 7.x-1.0-beta1 » 6.x-1.0
Priority: Normal » Major

I 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:

      preg_match_all('/ class="r"><a href="([^"\?]+?)["\?].*?class=l.*?>/', $html, $links);

to

      preg_match_all('/ class="r"><a href="([^"\?]+?["\?])*?>/', $html, $links);

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.

paulhudson’s picture

Hey 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