✓ I'm available for hire! Check out my open source work on Github or drop me an email

Douglas F Shearer

Flic.kr - Flickr Short URLs Explained

Flic.kr links recently began appearing on Twitter and around the web, so I did a little bit of digging. Twitter has brought about a wild storm of URl shortening services, and some issues surrounding them. James Duncan Davidson has a good summing up of these, and some of the solutions.

One of these solutions is to use a link tag on a page to give an alternative short URL. Flickr has started to support this, as so…

On a photo page, say http://www.flickr.com/photos/douglasfshearer/3447346323/, we find in the source:

<link rev="canonical" type="text/html" href="http://flic.kr/p/6fCxXz" >

Twitter clients can now take a pasted Flickr link, and go look up this short url on the Flickr page, without making use of a third party service such as tr.im. Good stuff.

This also works for user accounts, as an example, mine would be http://flic.kr/douglasfshearer.

Tools

The short photo URL is the photo ID converted to Base58, so you need to turn one into the other.

The item that really brought this to my attention was Fraser Speirs Base58Encode Objective-C class, ideal for those of you making Twitter clients.

I’ve released a RubyGem for this, Base58, and a CLI script that takes a flickr URL and gives you the short version.

 
 

Comments

Gravatar

Matt

November 10 2009 18:57

Thanks for the explanation!

Gravatar

Elliott Plack

May 11 2009 13:39

Doug,

Thanks for the info, I've been looking all over for this. So I can't seem to find the shortlink in the source. Mine says for instance.

Gravatar

Douglas F Shearer

May 12 2009 17:59

Hi Elliot.

I wonder if the short URLs are only enabled for select users, or maybe those with developer keys.

I looked in the source for the link you posted, and got http://flic.kr/p/....

Gravatar

The One True b!X

May 27 2009 05:07

I can't see them on my photo pages' HTML source either.

Gravatar

Michael

June 11 2009 19:28

The Flickr short URLs only seem to appear if the page URL is a direct link to the photo, and so does not include something like "/in/set-72123456789902170/" part at the end of the URL. If it does remove this from the address and reload the page.

So the URL should be just something like:

http://www.flickr...

Secondly, do not confuse the tag with the one.

The "rel" version appears first amongst the meta tags. You need to look a little further down. At the moment, anyway, there is a CSS stylesheet entry, some white space, then the Flickr short url entry appears above the tag.

Add Your Comments

Commenting is closed for this entry