How to create a link that uses Google's "I'm Feeling Lucky"?

5

2

I would like to send a visitor to this page:

http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=6920927181221

But if there is no referrer to http://www.google.com, the functionality I'm feeling lucky doesn't work.

Do you have any idea how to do so?

Natim

Posted 2009-10-16T05:07:06.293

Reputation: 1 531

So you want to redirect the user to the first google match on a specific search term? – salle – 2009-10-16T05:49:34.213

2

Or alternatively, maybe you can use "Let me google that for you": http://lmgtfy.com

– Arjan – 2009-10-16T09:56:49.203

As for the original title, "How to open an URL in a browser with a refer(r)er page?": you really can't do that without hacking the browser (or without proxying the result through your own server). So, I've changed the question for future reference. (Especially as that button seems to be disappearing from the new Google homepages.) – Arjan – 2009-10-16T10:14:28.670

Answers

4

Put this on the end:

&sourceid=navclient

So that your URL is like this:

http://google.com/search?btnI=I%27m+Feeling+Lucky&q=6920927181221&sourceid=navclient

For example: Stack Overflow, which when clicked will have the HTTP REFERER header set to http://superuser.com/questions/56021/[...]. The same link sent through email, or when opened using right-click » Open Link in New Window, will have no REFERER set at all (in most browsers). All seem to work fine.

random

Posted 2009-10-16T05:07:06.293

Reputation: 13 363

Am deliberately not creating it as a link. – random – 2009-10-16T06:21:31.213

Note that Google is changing the URLs. This might keep working forever, or a long time, or maybe will fail sooner than we think. See http://stackoverflow.com/questions/1122523/google-using-instead-of-search-in-url-why

– Arjan – 2009-10-16T09:58:24.130

1I initially thought the question was about sending a link through email or whatever (having no REFERER at all), and actually I'm a bit surprised that this also still works when using ANOTHER referrer, like when linked from another site. But: you're right, it does work. I've added a safe link to Super User as an example. – Arjan – 2009-10-16T10:27:06.303

2This seems to be sensitive to the query. The example query works, but for some other search queries, it still gives the results page instead of redirecting to the first result. It's not clear to me what separates the two scenarios. – Cheetah – 2013-03-12T14:41:31.353