Branimir's Blog Archive

branimir.com : Branimir's Blog

Tuesday, October 21, 2003

Internet Keywords - Command Line Interface to the Web

When I want to look up Leo's German-English dictionary I just type "leo foo" in the Location field of my Mozilla. When I want to look up a RFC I just type "rfc 2070". This works thanks to Mozilla's delicious feature called Internet Keywords. Here's how it works: If I type into the Location field something that doesn't look like a Web address Mozilla visits a special URL (in my case http://branimir.com/kw?q=) appending to it whatever I have typed into the Location field. So, if I type "leo foo" Mozilla will request:
http://branimir.com/kw?q=leo+foo
Now, my little AOLserver script (source is available) will then redirect me to something like:
http://dict.leo.org/?search=foo&searchLoc=0&relink=on&spellToler=standard...
If you look at the above source code you can see that Google is also supported: just type the search terms.

In order to take advantage of this feature I just had to edit my Mozilla preferences file prefs.js like this:

user_pref("keyword.URL", "http://branimir.com/kw?q=");
user_pref("keyword.enabled", true);
You can use my server for this if you want. But if you are a hacker you'll probably want to customize the script so you'd be better off with your own.

This stuff is inspired by Lars Pind's Shortcuts. I liked the idea when I read it a while ago but syntax seemed awkward. With Internet Keywords I just type Command-L (Mac) or Ctrl-L (Linux, Windows) and I can immediatelly start to type my "command line".


Posted by Branimir Dolicki at 20:51

# - G - 2 comments - Add comment

» Branimir's Blog
» Archive

You may request notification for Branimir's Blog.

bdolicki@branimir.com