nc Bookmarklet

Here’s a bookmarklet that may be of use to someone reading this blog. Recently Flickr introduced canonical short URLs for all photos hosted by the site. If you look at the source code for a Flickr photo page, you will see a new link element that looks similar to this:

<link rev="canonical" type="text/html" href="" >

As I write this, there doesn’t seem to be a way to retrieve this URL through the page itself, so I wrote a bookmarklet that would pull the canonical short URL from DOM tree. I’ve tested the bookmarklet in Firefox and Safari.

Drag this to your bookmark toolbar: Get URL

See-ming Lee: Works perfectly - would be even more awesome if the bookmarklet copy and paste the shorten URL into clipboard automatically (I suppose I can do that, but then I’m lazy) :)

Neil Cowburn: Copying to the clipboard via JavaScript in a way that’s cross-browser compatible is a bit of a minefield. I’m happy with Cmd-C.

Marc Pfister: This is rad! Can you make it work on photos that have an in/set-XXXXXX url?