Firefox Plug-ins And Searchable Markup


Today, I’m work­ing on a Flickr search engine for Fire­Fox. I was real­ly sur­prised that no one had thought to cre­ate one yet, give Flick­r’s huge pop­u­lar­i­ty. Okay, maybe I’m more of a fan that your aver­age Joe (or Jane), but it does seem to be pret­ty hip with the kids. Any­way, these lit­tle search plug-ins are real­ly pret­ty easy to write and they are extreme­ly handy.

That being said, when you look at the code from a search from Google, you’ll notice lit­tle remark tags before and after each search result item:

<!--m--><a href=>super_structure | <b>Jason</b> <b>Coleman</b></a><br><font size=-1><b>...</b> And The Coal Men — singer Dave <b>Coleman</b> and cohorts Dave Ray and <b>Jason</b> Hitchcock [yada, yada, yada]<!--n-->

As you can imag­ine, those lit­tle remarks con­tain­ing m & n make for very nice search strings. The set of search results for each page returned are also bound in sim­i­lar remarks, with a & z (get it? From “a” to “z”.). Yeah, any­way, most of your oth­er sites don’t con­tain such lux­u­ries (like, say, Yahoo). Flickr, sad­ly, has even less. The results from a tag search at Flickr, such as “cam­er­a­phone” don’t con­tain any delim­i­na­tors to speak of. Of course, the idea here is that you just use part of the mark-up as a text string in your search for where an item begins and ends, but that does­n’t work so well. Of course, the nat­ur­al markup would be <li> & </li> (Flickr uses <p>, which is the same for this argu­ment), but alas, that’s no good when you add a class, id, or style which con­tain ” ‘s (quo­ta­tion marks). The prob­lem is that those ” ‘s trun­cate your text string pre­ma­ture­ly. (Also, Fire­fox does­n’t seem to under­stand using &quot; in this context).

All this being said, I’ve sub­mit­ted my lit­tle code to the Mycroft peo­ple at Mozil­la, so maybe it’ll be up there soon. You can down­load the file right now from me, and just stick it in the \Mozil­la Firefox\searchplugins\ direc­to­ry and restart Fire­fox. You won’t have an icon just yet for Flickr. They like those to be down­loaded from their site, as opposed to just any old place.

I think that Google’s use of the remark tags as delim­i­na­tors is a pret­ty nice lit­tle fea­ture that 99.9% of users nev­er know about, but can ben­e­fit from because of fea­tures like the tool­bar search in Fire­fox. If you hap­pen to have installed the side­bar search, and have my Flickr search, then doing a search on a term in both Flickr & Google simul­ta­ne­ous­ly will show you the ben­e­fit. Google returns results just like the Google page. My Flickr plug-in only returns the thumb­nail (non-hyper­linked) and the cre­ator (also, non-hyper­linked). I had found a way to include the title of the pho­to, but then the link for the result went to the cre­ator’s “pho­to­stream” and not the indi­vid­ual pho­to. Is there a way around all this? I’m sure, but I’m not a good enough code writer to do it. Plus, I doubt most peo­ple even know about the side­bar search, let alone use it.

Up next, a search plug-in for Wired News!

Categorized as Geek

By Jason Coleman

Structural engineer and technical content manager Bentley Systems by day. Geeky father and husband all the rest of time.

1 comment

  1. nice plu­g­in. I think the Mycroft peo­ple are behind in post­ing plugins

Leave a comment

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