Google Numbered Search Results

By Stephen Cronin Last update May 18, 2010 — Installed 9,138 times.

Endless request loop to Google when no search results

in
Subscribe to Endless request loop to Google when no search results 6 posts, 3 voices



chris2006 User
FirefoxWindows

The script does what it does, except for one situation:

When there are no search results, then the scripts gets into a loop request to Google, making also the tab/browser freeze and finally getting back an error page from Google, telling me that it seems like automatic requests are made from my machine. I hope this will be fixed, because apart from this bug, I like the script as an addition to other Google enhancements.

 
Stephen Cronin Script's Author
FirefoxWindows

Hi Chris,

Thanks for finding this problem and sorry about the delay in my noticing it! I'll have a look into this over the next couple of days.

Stephen

 
Stephen Cronin Script's Author
FirefoxWindows

Hi Chris,

I can't replicate the problem. If you read this, could you please provide me with an example search term that causes the problem?

I tried searching for:

sakdfjsadkjk kjsadfhjksadhkfaskdjf

and got the following response from Google:

Your search - sakdfjsadkjk kjsadfhjksadhkfaskdjf - did not match any documents.

My initial search was using the new AJAX powered results, so the script redirected it to the old non AJAX equivalent, but it stopped there. It sounds like you were experiencing a redirect loop, but I can't seem to make this occur for me.

 
SimpleUser User
FirefoxWindows

Hi Stephen,

Thanks for this script, it is great.
...But like chris2006, I've got the endless loop problem. Try this url for example:

http://www.google.fr/search?hl=fr&source=hp&q=erhehjtrjykty346her&btnG=Recherche+Google&meta=&aq=f&oq=erhehjtrjykty346her&sjc=1ca5e60034dece81

Regards,

David.

 
Stephen Cronin Script's Author
FirefoxWindows

Hi SimpleUser,

Sorry for the delay - I didn't see this until now.

I've worked out the problem. Because the new AJAX powered search doesn't have any results at the time the Greasemonkey script runs, this script can't work. Therefore, if there's no result set, it redirects to the old Google search, which does have results.

The problem comes when there is legitimately no result set (because they don't exist for the term). To stop the endless loop, I check for the term "did not match any documents" in the page.

I'm sure you can see the problem. It works fine for English language Google searches, but not for other languages. For example for this to work in French, I should be checking for the presence of "Aucun document ne correspond aux termes".

I can't really check for every language that Google has, so I'm going to reconsider the logic and see if there's another way of doing this (I think there is, but I need to think about it).

This is only a part time thing for me, but I should have a fix in the next few days to a week.

Cheers,
Stephen

 
Stephen Cronin Script's Author
FirefoxWindows

Okay, I've found a way that will work for all languages. New version 1.1 has been uploaded. Please let me know if you have any problems...