Saturday, January 21, 2006

">" - the Universal I'm Feeling Lucky command

This evening, I found the following note in my inbox from Fuska:

COOL!!! elzr, I love this command
It's like a universal "I'm feeling lucky" button.

I think it deserves a Golden Egg right now

Did I say that I love it?

Fuska was raving about a new command called ">" -- not by Fuska himself but by Eliazar. I dug through my mailbox and found Eliazar's note announcing the ">" command. It's a super-cool command:

I read in a recent post about "amr" (Amazon through Google's Feeling Lucky) and thought it was a great idea. Exploring Yubnub I found a couple of other similar examples --"gww" (Wikipedia through GFL), "lfl", and "amluck" (interestingly, it does basically the same as
"amr")-- and thought that this could be an interesting pattern to exploit: using Google's Feeling Lucky as a fast, efficient and direct gateway.

Being in love with Yubnub, I thought about this in command terms and after some thinking came up with ">". I chose a symbol because I think it could become a fairly common command and because the syntax it allows is quite nice -- it makes me think of directness (->) and compression (><), which I think is appropriate. Here's how it works: (from it's man page)


URL: gfl site:{ extractDomainName { url {% 1 %s} } } {% 2- %s} [no url encoding]

> [Yubnub command] [query]

> wp Figures of speech
results: the article in the English Wikipedia about Figures of speech

> wpde Jonathan Ive
results: the article in the German (de!) Wikipedia about Jonathan Ive

> am The Future and its Enemies
results: the page in Amazon for Viginia Postrel's book The Future and its Enemies

> imdb Amelie
results: the page in the IMDB for Le Fabuleux destin d'Amélie Poulain

> cia India
results: the CIA Factbook entry for India. (And this is is a much convenient than just using "cia", since then you have to know the country two letter code.)

> cnn NYC transit workers
results: the CNN article "New Yorkers walk as transit strike ruled illegal." This brings up a subtle point: this is not be the most recent article in the topic, but rather the most important article on CNN about NYC transit workers according to Google. So ">" can be interpreted to mean: Quick! Take me to the most important page in this site related to this query.

> lj annzah
results: the LiveJournal user page of the user Annzah.

> kottke just enough
results: Kottke's post "Just enough is more"

> / Shockwave Rider
results: an article in Slashdot about Schockwave Rider

In practice, what ">" does is search a "content" website through Google for your query and send you straight to the first result. It is convenient because it builds on your knowledge of Yubnub commands and because it is often more direct.

Here's a more precise description: Yubnub generates a URL by interpreting the 1st param as a Yubnub command, it then extracts a domain name from that URL and uses it to configure a Google Feeling Lucky search for the 2nd param.


The command is far from perfect but I hope it's useful. The one think that's killing me is that it's slow! The domain extraction mini-script (man extractDomainName) is hosted on my server and that brings the total speed down. A command is as fast as it's slowest sub-command. This is a pity, Google is pretty much as fast as you can be in the web. But more importantly, being fast is the raison d'etre of this command. Suggestions please!

Oh, and this is the first Yubnub command after "man" that eats (has as a parameter) other Yubnub commands, right?

Cheers to Yubnub!



Post a Comment

<< Home