Taking advantage of extensibility (my first Greasemonkey script)

Flickr: Love it, just starting to use it frequently. Firefox: Love it, just starting to use it frequently.

Both Firefox and Flickr are extensible (via a web API and by extensions like Greasemonkey, respectively). As a user of Flickr, I realized there was a feature I'd like to have. So I built it using Greasemonkey.

The feature is "Show related tags" on the Flickr upload screen - when I'm uploading images, I'd like to see what other people are tagging similar things (for clarity, like "nyc" vs "newyork" - or for inclusion, like "cat", "kitty" and "kitten"). Well, now I can. I wrote a Greasemonkey script that inserts "Show related tags" into the upload page (screenshot1). If you enter some tags, and click the link, the page will load up sets of related tags for you to browse and/or add by clicking (screenshot2).

How does it work? Greasemonkey lets me inject script into any page (viewed in Firefox), and the script I injected is set up to fetch XML from Flickr's Web API, showing tags related to a chosen tag. It uses XmlHTTPRequest, Javascript & XML. (There's gotta be a catchy name for that technology somewhere.) The cool part is - cross-domain issues aren't an issue, since the host page and the XML both come from the same domain - 'flickr.com'.

How can you use this too? First, be a logged-in user of Flickr, Second, use Firefox, Third, make sure you have the Greasemonkey extension installed, Fourth, right-click on this link: flickrelatedtags.user.js, and choose "Install User Script". Once that's done, navigate to Flickr's upload page, and you should see the "See Related Tags" link show up below the "Add Tags" form field.

Please, feel free to send bugs, problems and/or suggestions my way.

More about Greasemonkey here and here. More about Flickr's API here. And another lovely app that uses Flickr's API to examine related tags is this Flash Tag Browser.