tags:

views:

160

answers:

1

In a PHP script I want to get just the URL of the top result of a Google search and redirect to it. I could scrape it but is there a better way?

+9  A: 

Use the I'm Feeling Lucky function.

Example:

http://www.google.com/search?hl=en&q=stackoverflow&btnI=I'm+Feeling+Lucky&aq=f&oq=

It automatically takes you to the top result.

Michael Haren
Ah of course! That should work, thanks!
yjerem