I biq, Ubiq, we all biq: Accessing Metalink through Ubiquity

Do you recall the bygone days of the middle of last week, before the entire Internet got distracted by Google Chrome? Back then, one of the big stories was Ubiquity, a very cool (and still very alpha, which suggests that 1.0 is going to be amazing) Firefox extension that enables a new, intuitive way of interacting with your browser and, by extension (hah), the Internet and its myriad services. As a Quicksilver fan, I was familiar with the idea: think of something, type a few keystrokes, accomplish that something, and get on with whatever you were doing before you had the thought. Very Nice.™

I first caught wind of Ubiquity via Merlin Mann (his tweet on the subject, while potentially NSFW, is a model of succinct effusiveness). Then I saw that Jake at Oracle AppsLab had also posted about Ubiquity, and that Eddie Awad and Don Seiler had already whipped up some cool Oracle-related Ubiquity commands, and it got me thinking...

Everyone can play

Well, okay, maybe not your grandma. But even people like me, non-programmers with zero-until-last-week JavaScript experience, can put together a half-decent Ubiquity command. I know this because I've tried and, with some admittedly ugly code and questionable logic, succeeded.

The problem I wanted to solve was, "How do I provide someone with a useful link to a Metalink document, whether in email, on an OTN forum, or on my blog?" I could just type "Check out Note 123456.1" and be done, but it's much more polite to provide a link to the document on Metalink itself. Ideally, I would produce something that contains:

  1. The Metalink Doc ID
  2. An URL to load the document, clickable where appropriate
  3. The subject of the document, so the recipient gets an idea about what they're going to read

Naturally, I'd want to do this with as little typing as possible, and avoid waiting for Metalink pages to load just so I could copy and paste. I've already managed #1 and #2 in the above list using TextExpander, but #3 was out of scope for me until Ubiquity came along, and allowed me to create "metalink-urlify."

It took a little bit of doing. As I stated earlier, I've never written JavaScript before, much less jQuery and AJAX and all this other stuff that all the cool kids take for granted these days. Nonetheless, by standing on the shoulders of giants, I managed to bang out a Ubiquity command that meets my need:

  1. Takes a Metalink Document ID (123456.1, for example) and an optional format directive
  2. Checks to see if you have an open Metalink session
  3. If so, access the document on Metalink to grab the title
  4. Copy an appropriately-formatted string to the clipboard, ready for pasting wherever you'd like

Admittedly, copying text to the clipboard feels a bit clunky and non-Ubiquity-like (non-Ubiquitious? non-Ubiquitish?) in this context, but given that I could be using the string in any number of apps outside my browser, it seemed to be the lowest common denominator. Maybe someday Ubiquity will extend its influence to the rest of the OS, but until then, this will do.

The menu looks like this (update: with the added bonus of seeing my Google Reader window through the transparent background, ye gods I feel like a noob):

After a hopefully small delay, Ubiquity should notify you that it's constructed the requested string and copied it to the clipboard:

(Apparently there really is a document 123456.1. Neat!)

To access the actual output of the command, of course, you'll need to use Ctrl-V (or Cmd-V, if you're fortunate enough to be using a Mac).

And that's my first lumbering entry into Ubiquity command authoring. The help section in the command definition contains more extensive usage notes and sample output. Please check out metalink-urlify, and let me know what you (all 5 of you) think. I hope it can be of use to someone besides myself, and I apologize in advance if looking at the code causes anyone pain. ;-)


  1. Rick
    Posted 22 April 2009 at 15:06 | Permalink

    Love this new tool. How do I lookup the source behind the commands I just added?

  2. Posted 22 April 2009 at 18:42 | Permalink

    Hello Rick,

    I'm glad that you're finding this useful. Here's a direct link to the source for my commands. Source for Ubiquity commands also appears to be stored in a sqlite database file called ubiquity_ann.sqlite in the Firefox user profile directory, though I haven't dug into that very much yet. :-)

    Thanks for the visit!


    John P.

Post a Comment

Your email is never published nor shared. Required fields are marked *