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

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 <link rel="canonical" href="http://www.flickr...; /> 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 <link rev="canonical"> tag with the <link rel="canonical"> 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 <link rel="shortcut"> tag.

Gravatar

Matt

November 10 2009 18:57

Thanks for the explanation!

Add Your Comments


Commenting is closed for this entry.

 

You Are Here


Douglas F Shearer

This is the homepage of Douglas F Shearer, a software developer and mountainbike racer. More…

Hire Me!


I'm available for hire. Ruby, Java and PHP work, both remotely (Worldwide) and locally (Scotland). Find out more or email me.

Flickr Latest


Stay Informed


What is RSS?

Categories


  1. Bike (90)
  2. Coding (84)
  3. Other (46)

Top Tags