12
4
I'm making a little script with Autohotkey to quickly go to the first Google result of a search term. My problem is, the only method I've found for doing this though the URL is acting a little inconsistent.
http://www.google.com/search?q=searchterm&btnI=745
This only works when the first hit is deemed to be a very good match. Otherwise Google shows the normal 10 results. However, the actual "I'm Feeling Lucky" button on their front pages always takes you to the first result.
Try these links:
http://www.google.com/search?q=new%20york&btnI=745 <- works
http://www.google.com/search?q=new%20york%20dijon&btnI=745 <- doesn't work
"new york dijon" on the front-page and then hitting "I'm Feeling Lucky" does work though.
Any idea how I can get it to consistently work in URL form?
Edit: Okay, seems this might not be doable in a single URL. I'll mark a greasemonkey-script workaround as correct if posted.
Is there any update on this? I'm trying to create an AutoIt script that goes straight to the first result. Now, I must resort to going to google.com first and press the I'm lucky button. The only condition is that I'd prefer not to use an extension/plugin. I'm using Chrome. – Daan – 2014-10-04T19:36:17.287
These fail:
google.com/search?q=new%20york%20dijon&btnI=Im+Feeling+Lucky
,google.com/search?btnI=1&q=new%20york%20dijon
,google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=new%20york%20dijon
– Ivan Chau – 2013-12-31T03:59:38.780I guess the safe search functionality hinders the feature. – Ivan Chau – 2013-12-31T04:19:54.210
I'm going to try seeing how the HTML form is set up in Firefox with Noscript enabled. – Just Jake – 2014-01-07T11:17:25.150
This article might also interest you. According to it, it works with 2 keywords, but not 3. And even then somehow, not always ;( I think
btnI
works with up to 2 keywords AND if Google does not decide you might have typed something wrong (likeDid you mean: geeks alive
). Otherwise a bit of javascript is used to redirect you. – Rik – 2014-01-07T12:22:32.697@JustJake, the lucky button contains a non-standard attribute:
jsaction="sf.lck"
. – Synetech – 2014-01-08T01:13:48.820The form uses
btnI=submit
, though any value is sufficient, so long asbtnI
is not null. @BlueBerry, where did you getbtnI=745
? Also, Rik(’s article) is correct, usingnew dijon
works from the URL and you are correct thatnew york dijon
works from the homepage. Very odd that they would make such inconsistent behavior. – Synetech – 2014-01-08T01:16:59.550Just a random reminder: The result for "I'm feeling lucky" does not necessarily match the top result for the same query. – nitro2k01 – 2014-01-14T17:55:56.213