Linux.com

Feature

YubNub: A command line for the Web

By Mayank Sharma on February 21, 2006 (8:00:00 AM)

Share    Print    Comments   

Tired of dragging your mouse from one Web site to another, trying to get to the best of the Web? Give YubNub a run. Its name means "hooray" in Ewok, and it might just make you jump for joy. Its developer, Jon Aquino, calls YubNub the URL command line of the Web OS. It provides a portal to hundreds of searchable Web sites.

YubNub can get information by using any Web service. YubNub can search Wikipedia, hunt down the closest pizza place using Google Maps, help you find the latest posts on a particular subject using Technorati, translate pages into English, generate tiny URLs, and perform calculations.

The YubNub home page looks a lot like Google, with a one-line text box in the middle. But unlike traditional search engines, queries in YubNub have a command prefixed, which specifies what needs to be done with the query. So if you want to search for FreeBSD on Wikipedia, enter wp freebsd at the YubNub command line. tec freebsd will get you all the latest posts on FreeBSD through Technorati. And if you need screenshots, try flk freebsd, which looks through Flickr, or try gim freebsd, which looks through Google Images.

YubNub has more than 500 commands. Typing ls in its text box gives you a list of all commands, and typing man command-name gives you the man page of that command. But it's better to check out YubNub Golden Eggs for a list of interesting commands. The site also has a list of most-used commands.

Aquino says anyone can extend YubNub. "If a new search engine comes out, you can add it to YubNub in seconds on the Create page." For example, let's create a command to search for articles on NewsForge. Go to the Create command page and type in the name of the command. Let's use nforge. Next, enter the URL that searches the site -- the Search facility on NewsForge. So the URL in this case would be http://www.newsforge.com/search.pl?query=%s. That's about it. Make sure to test the command and enter a usage description before pressing the Create My Command! button.

Another interesting feature of YubNub is its support for a limited form of piping (small snippets of text), which made possible the ifThen and if commands that users wrote. For example, we could enhance the nforge command above using ifThen so that when users type nforge without any strings, it takes them to newsforge.com, whereas if they type nforge linux, it searches NewsForge for "linux". It would look like this: http://www.newsforge.com{ifThen -value1 %s -value2 -test NOTEQUAL -then /search.pl?query=%s}.

YubNub began life as an entry to the Rails Day 24-hour programming contest in early 2005 (eventually winning second place). The Ruby on Rails source code of YubNub is available under the MIT License. Aquino says the code is pretty mature and doesn't change much these days, other than occasional documentation tweaks.

Instead of using YubNub through the command line at yubnub.org, you can integrate it into your desktop and applications. There's a Firefox search plugin, a bash script to integrate YubNub into the command line, and a GreaseMonkey script that adds YubNub to Google. You can also use it with emacs. Check out the Installing YubNub page for ways to use YubNub.

YubNub resembles Yahoo! Open Shortcuts, which is currently in beta. On the YubNub blog, you can find a couple of entries on integrating it with Open Shortcuts.

Although YubNub's commands might take some getting used to, after you take to it, it will save you a few clicks and a noticeable amount of energy.

Share    Print    Comments   

Comments

on YubNub: A command line for the Web

Note: Comments are owned by the poster. We are not responsible for their content.

firefox's search keywords

Posted by: Anonymous Coward on February 22, 2006 04:28 AM
This is redundant for users of Firefox's search keywords. It even uses the same %s keyword substitution token. The advantage of search keywords is that you don't need to depend on yubnub to be online, or worry about privacy issues.

Oh, and you can even use search keywords in javascript bookmarklets, for more sophisticated behaviours.

#

Re:firefox's search keywords

Posted by: Anonymous Coward on February 22, 2006 04:32 AM
<a href="http://www.yubnub.org/documentation/describe_advanced_syntax" title="yubnub.org">http://www.yubnub.org/documentation/describe_adva<nobr>n<wbr></nobr> ced_syntax</a yubnub.org>

now, the advanced syntax has something new!

#

Re:firefox's search keywords

Posted by: Anonymous Coward on February 22, 2006 05:04 AM
Not quite. The advantage of this is that it's usable by just about any browser, it seems more powerful to me, and you can use commands others have made.

#

Script link is broken - here is an alternative

Posted by: Anonymous Coward on February 22, 2006 05:09 PM
Unfortunately the link to the bash script is broken.

Here is an alternative <a href="http://konradscons.blogspot.com/2006/02/web-small-script-for-yubnub_22.html" title="blogspot.com">simple shell script</a blogspot.com>.

#

Wrong translation

Posted by: Anonymous Coward on February 23, 2006 01:16 PM
Actually, according to the sheet music for the Ewok victory song, "Yub nub" (two words) means "Freedom", not "Hooray". The first line of the song translates as "Freedom, we've got freedom. And now that we can be free, come on and celebrate!"

OK, yeah, I'm a geek, but I'm also a stickler for accuracy.<nobr> <wbr></nobr>:-)

#

Yubnub and Mobile devices

Posted by: shantanuo on February 23, 2006 09:03 PM
Two letter commands like wp for wikipedia are especially useful for mobile devices.

The command mo will generate mobile device version of the redirected page, without ads, CSS or JavaScript. For e.g.
mo wp india


and when I use the commands like <a href="http://yubnub.org/kernel/man?args=rss2pdf" title="yubnub.org"> rss2pdf </a yubnub.org>, I feel like I am using an application from command prompt!

#

Sounds a bit like Surfraw

Posted by: Anonymous Coward on February 23, 2006 09:55 PM
<a href="http://surfraw.sourceforge.net/" title="sourceforge.net">Surfraw</a sourceforge.net> ("Shell Users' Revolutionary Front Rage Against the Web") "provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power." Has anyone used both? Can someone cite advantages of yubnub?

#

Re:Sounds a bit like Surfraw

Posted by: Anonymous Coward on February 25, 2006 02:55 PM
Someone's actually written a yubnub plugin for surfraw so you can get the best of both worlds - details here: <a href="http://yubnub.org/documentation/describe_installation" title="yubnub.org">http://yubnub.org/documentation/describe_installa<nobr>t<wbr></nobr> ion</a yubnub.org>

#

Just like Konqueror

Posted by: pdorman on February 24, 2006 03:03 AM
Konqueror (the KDE browser) has had this for a long time. To search freshmeat.net for instance, I just type "fm: blah" in the URL bar and it searches freshmeat for me. Good to have on other platforms though.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya