Rant 11 - Cube Search Plugin

Isn't this unusual, a real bit of code (well, a good copy-paste-improvise job). For the purposes of documentation I have the entire plugin laid out below, and then I'll explain it a bit.

But first I need to explain what this is, don't I? This is a (hopefully functional) plugin for Mozilla Firefox that will allow users to search the Cube Engine forum from their browser, rather than having to get to a page. If you're still not sure what I'm talking about, here's a screenshot of the default google search plugin, highlighted in red:

Ok, here's the actual code which goes into a .xml document.

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://www.opensearch.org/Specifications/OpenSearch/1.1">
<ShortName>Cube Engine</ShortName>
<Description&rt;Find information and posts on the Cube Engine forums</Description>
<Image height="16" width="16" type="image/x-icon">http://www.quadropolis.us/favicon.ico</Image>
<Url type="text/html" method="get" template="http://cubeengine.com/forum.php4?action=display_search&keywords={searchTerms}"/>
</OpenSearchDescription>

Now, the first line is pretty self explainatory. What kind of XML are we dealing with. Similarly, the second line simply tells Mozilla what it's working with.

The third and fourth paragraphs are also really simple: the title and description of the plugin. No sweat yet, everything so far has been simple fill-in-the-blanks.

The firth line is a lot of fun. In the tutorials I read, I'm supposed to throw up the actual binary of the icon there. Heh heh, no. It was much more logical to link to an existing favicon over at Quadropolis. It cuts down on complications for me and the script, and give Quadropolis a nod.

The sixth line is what really matters here, so naturally, I have only a feeble grasp of what it's doing. :( But what I've done, to the best of my knowledge, is declare the method used to do the search, and provided a URL template. {searchterms} is being the wildcard of the equation, if you will, allowing for the actual search.

And finally, the last line closes things off neatly. As you can see, there's not much to what I've done, and that's on purpose- Cube is all about doing more with less, so that's what I've tried to do here.

One last thing: as I said, it's saved in a .xml document. In order to make a plugin downloadable from a site, this code needs to be put in the header (modified to suit, of course):

<link rel="search" type="application/opensearchdescription+xml" href="cubeengine.xml" title="Cube Engine">

I hope this rant is useful to somebody out there, or even better, gets somebody to make more search plugins for the places I visit.

-Tentus