Leveraging the Ubiquity FireFox Plugin To Access CFQuickDocs Pages

If you're a FireFox user and you haven't tried out the new Ubiquity plugin created by the folks at Mozilla Labs, you should.

What is Ubiquity? The short answer is it's a command-line interface for retrieving and re-purposing web content. For example, the "wikipedia" command built into the plugin takes the word you type in, retrieves data from the top 5 matches for that word (as you type it, no less) in Wikipedia using an API, and displays that data with clickable links to the Wikipedia pages in the command window:

You can see even more interesting uses for Ubiquity by watching the video clip in the Ubiquity blog post.

One of the things about Ubiquity that hasn't been talked about very much is that you can create your own Ubiquity commands using JavaScript and then share those commands with other Ubiquity users (note to jQuery users: Ubiquity commands can use jQuery functions as well as regular JavaScript functions). To that end, I created a very simple command that lets me call up a particular CFQuickDocs page by typing "cfquickdocs" and the name of the CFML tag or function I want to look up:

As Ubiquity commands go, it's not that impressive, but it does let me pull up a particular entry faster than I used to (which involved going into my bookmarks, clicking on the bookmark, waiting for the page to load, and then entering the tag or function I want to read about). And all it took was one function call with four parameters:

makeSearchCommand({
name: "cfquickdocs",
url: "http://www.cfquickdocs.com/?getDoc={QUERY}#{QUERY}",
icon: "http://www.cfquickdocs.com/favicon.ico",
description: "Searches the CFQuickDocs for the CFML tag or function you enter."
});

Sharing a Ubiquity command is simply a matter of putting the command in a JavaScript file and then creating an HTML page that calls that file. If you already have Ubiquity installed, you can install this CFQuickDocs command into your Ubiquity plugin by going to the following URL:

http://www.swartzfager.org/ubiquity/cfquickdocs.html

If you don't have Ubiquity installed but want to learn more about developing Ubiquity commands, there is an online tutorial that explains the basics. Once you have the plugin installed, you'll have access to a command editor that lets you try out your commands as you code them, and you can read the code for all of the functions that come built into the plugin.

Comments
Brian,

Is there a way to install a Ubiquity command once it is installed?

For example I would rather have the keyword for the command be CF which is what I have always used as a bookmark keyword for cfquickdocs.
# Posted By Michael Brennan-White | 8/29/08 10:56 PM
@Michael: If you're asking if there's a way to _uninstall_ a command, I must confess that I don't know. I was looking for instructions on how to do just that earlier today and didn't find any.

As you type a command, Ubiquity will try to autocomplete/guess at it. So if you don't have another command that starts with the letters "cf", you can use my plugin to just type "cf", a space, and then the tag or function name and it will still work.

Alternatively, if you haven't installed my CFQuickDocs command, you can just open the command editor that comes with Ubiquity, copy and paste the code from this blog entry into it, and simply change the name from "cfquickdocs" to "cf". You'd essentially end up with the same function, just with the command name you prefer.
# Posted By Brian Swartzfager | 8/29/08 11:39 PM
I ended up putting it in the command window as you suggested.

It would be cool if there was a way to edit an installed script similar to the way you can edit a greasemonkey script.
# Posted By Michael Brennan-White | 8/29/08 11:58 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.