Jud Dagnall Photography Blog

Photography, technology and occasional rants!

Smart bookmarks with Firefox keywords

Posted on October 28th, 2004 in by jud || 1 Comment

slamm showed me a cool trick with Firefox that I didn’t know. Firefox
allows you to save a bookmark as a shortcut that will accept variable
substitution. It’s more difficult to describe than to do, but here’s the
scoop. If you have a site that you need to enter in some text to get search results, then
there’s a good shot you can create a keyword shorcut.

For example, bugzilla has a user query form /buzilla/edituser.cgi. This
form accepts a single parameter, a userid, and displays information
about users who match. If you are a bugzilla administrator (as I am),
this is a page that gets used frequently. Rather than clicking on my
bookmark, clicking to the form and then hitting submit, I can simply
create a keyword shortcut so that when I type “bzu jdagnall”, I get information about user *jdagnall*.

But since most of you don’t use bugzilla, I’ll give you an example of how we would create a shortcut for the IMDB, the Internet Movie DataBase.

The IMDB has a search engine that can be used to get information about movies. Instead of having to click on my IMDB shortcut and then
go to the search box, type in my search terms and then hit the “search” button, I can simply create a keyword search called “imdb” and type
directly into my browser from ANY page.

In order to make a shortcut, we need to get a URL that is used to generate some results. Typically, we can do this by modifying an existing results
page. So when we’re done, we’ll be able to type “imbd donnie darko” into the browser’s URL bar, and immeditely get a search results from the IMDB about
the movie *Donnie Darko*.

Here’s what you do:

1. Go to the [IMDB](http://www.imdb.org)

2. Type “darko” into the search box, and hit “search”. This gives a search [results page](http://www.imdb.com/find?q=darko;tt=on;nm=on;mx=20) that
we will use to create our special keyword search. It’s typically *much* easier to start with a valid search results URL than to try to figure out the correct
syntax on our own.

3. Create a new bookmark from the page.

4. Right click on the bookmark you just created, and select “Properties”. (You could also use the “Bookmars” sidebar)

5. Edit the URL, replacing “darko” with the string “%s”. This can be a little tricky. Typically, the browser must
encode special characters like the space (which becomes a “+”, or “%20”), so be try to use only a single word as a search term when you’re building your keyword shortcut.
Sections of the URL are typically separated by the & symbol, you’ll want to leave that.

> http://www.imdb.com/find?q=donnie;tt=on;nm=on;mx=20

becomes

> http://www.imdb.com/find?q=%s;tt=on;nm=on;mx=20

Firefox will replace “%s” with anything you want, and then run the search and show you the results.

6. Once you have added “%s”, create a name for your keyword search (“imdb” in this case) and use the “keyword” field to record it.

7. Close the bookmark.

8. Now you’re ready for a new search.

9. Click on the Location Bar in firefox (or press CTRL-L) and type **imdb two towers**

This should bring up a search that includes the movie *The two towers*

Add in the “Location Bar” keyboard shortcut (Alt-D or CTRL-L) and you can really fly:
Just type:

> CTRL-L imdb suburbia [enter]

And you’ll find a strange but very cool movie from the early nineties. This is how the various Firefox search shortcuts work, like typing “goog
some special word” and getting a google search for “some special word”. I
just never realized this, or dug around enough to modify any of them on my
own. Very cool!

One response to “Smart bookmarks with Firefox keywords”

  1. FFUser says:

    you dont even need to do that.

    just right click in the search box of the site where you enter your query.
    and choose “Add a keyword for this search”

Leave a Reply

Your email address will not be published. Required fields are marked *