Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a consistent way to link to Google "I Feel Lucky" result? [closed]

Tags:

html

search

In my application, I'm trying to create a simple way to link to profiles of NFL players on NFL.com based on their name. Because NFL.com's player profile pages do not have a predictable URL structure, I am trying to create a link to Google's "I Feel Lucky" results based on a URL string:

http://www.google.com/search?q=site:nfl.com+firstname+lastname+profile&btnI

The problem is: sometimes the link works and takes me to the first "I Feel Lucky" result, but sometimes it just takes me to the standard Google search results page.

Example 1 (takes me to first result, NFL.com):

http://www.google.com/search?q=site:nfl.com+Larry+Fitzgerald+profile&btnI

Example 2 (takes me to the Google search results page, not the first result)

http://www.google.com/search?q=site:nfl.com+Rob+Housler+profile&btnI

Is there a way to ensure I get the "I Feel Lucky" result every time?

EDIT

Here are additional examples of links that work and don't work. Note that the only differences between these links are the search terms yet some transfer you to the first Google result website and some take you to the actual search results.

Work (i.e. we are sent to the site of the first Google Result, NFL.com)

  • http://www.google.com/search?q=site:nfl.com+%22Jaron+Brown%22+profile&btnI
  • http://www.google.com/search?q=site:nfl.com+%22Dominique+Davis%22+profile&btnI
  • http://www.google.com/search?q=site:nfl.com+%22Drew+Davis%22+profile&btnI

Don't Work (i.e. we are sent to Google Search results page)

  • http://www.google.com/search?q=site:nfl.com+%22LaRon+Byrd%22+profile&btnI
  • http://www.google.com/search?q=site:nfl.com+%22Jared+Crank%22+profile&btnI
  • http://www.google.com/search?q=site:nfl.com+%22Early+Doucet%22+profile&btnI
like image 365
bperniciaro Avatar asked Sep 23 '13 02:09

bperniciaro


2 Answers

http://www.google.com/search?q=stackoverflow&btnI Replace Stack Oveflow with your words

like image 126
Mark Avatar answered Oct 19 '22 23:10

Mark


Whilst I agree with some of the comments regarding I'm feeling lucky being unpredictable, I managed to get those links working by including the players name in quotations. I'm not sure why it didn't work normally though. The following links work:

http://www.google.com/search?q=site:nfl.com+%22Rob+Housler%22+profile&btnI http://www.google.com/search?q=site:nfl.com+%22Larry+Fitzgerald%22+profile&btnI

Since I'm not from the US, I don't know any other names off the top of my head to test it with, but those two links work. %22 is quotations, so make sure to leave it around the players name.

like image 24
joshhendo Avatar answered Oct 19 '22 21:10

joshhendo