Neat tinyurl integration

Steven | Random Thoughts,twitter | Wednesday, 16 July 2008 - 11:48

The promise of tinyurl is simple: Making long URLs usable! And so they do. And with them lot’s of other similar services: bit.ly, snurl, is.gd, .. The idea is to keep the domain name as short as possible, than add a little hash at the end, and if a user hits that link the browser will redirect him to the page with the slightly longer url.

So, http://is.gd/UCi will redirect for example to http://www.minorissues.be, an small improvement indeed. The real beauty kicks in with very long parameterized links, like this Google Maps link. On that is.gd service it would become: http://is.gd/UCu. That’s 16 chars instead of 176. Impressive.

The principle is easy. They just keep a database with all these long urls, generate a code/hash at the same time, and match them. As soon as someone hits that code, they do a lookup, and redirect the user to the url that correspondents. The shorter the code, the shorter the url in total. With the 3 chars of is.gd you can make (26+26+10)*(26+26+10)*(26+26+10) = 62*62*62 = 238.328 combinations. 26 alphabetic chars lowercase, 26 uppercase and 10 numbers (might even contain special chars as well, dashes and underscores for example). So as soon they go over that number (not very long from now) they’ll probably add an extra char, providing space to 62*62*62*62 = 14.776.336 (almost 15 million) combinations.

So why would you want to use such a service, space is cheap, right? Well, not always. Think of twitter. You can only use140 characters to send your message. If you want to share a 200 chars url, you simply can’t do it.
No wonder the tinyurl-like services are widely used in these twitter-esque environments. It even is integrated in twitter for real. If you enter an url over xx chars, it will create an tinyurl (using tinyurl.com) from your link and displays it like that in your tweets.
Tools like twhirl (highly recommended) integrate a similar service: you can choose from a number of providers, and shorten your url on the spot, saving precious char space.

An other use of this url shortening services is to hide the source to what you’re linking. So you can trick someone in Goatse.cx or Rick Roll your victim. Worse: spam, mallware, .. You get the picture.
So I always had a double feeling about this. I like it on the on hand, saves you space. On the other hand, my judgement wether to click a link or not, is partly made by the link itself (is it a video, an image, a blog post, ..). Thin Slicing so to speak. I kind of automatically scan the status bar when I hoover a link. So, although I like it, I want to control it. Twitter doing it automatically is not me in control. Choosing to shorten the link is.

Yesterday we found out Twitter acquired Summize. Summize being a Twitter search engine, a very good on, so this indeed is a perfect match. They already merged the service in search.twitter.com.

I was checking it out, and discovered a very fancy and neat tinyurl integration in the search results, as you can see below.

tinyurl

tinyurl expanded

This is so natural and logic! It totally solves my problem.

redirect headerIt’s actually quite easy. This redirect is done with a HTTP header, resulting in a 301 (moved permanently) status, forcing the browser to get it’s request elsewhere.

On search.twitter.com (and probably before on Summize, but I never noticed) they created a script that when you feed it a tinyurl (or other service) it just returns the original url. Like you can see in this example. The script is called hugeurl :-)
So behind the scenes the script is doing a call to that tinyurl page, fetching the location header (in any) and just displays the result in the output.

I can only hope this is going to be implemented in twitter, and in twitter clients as Twhirl as well. So yes, this is an official feature request: make my day :-)

1 Comment

Sorry, the comment form is closed at this time.

RSS feed for comments on this post.