For those of us tweeting – or sharing web addresses in general – these long addresses with extensive query strings you wan’t to share isn’t too user friendly. So we have Bit.ly, among others, that lets you shorten a URL – or give it an alias if you like – and also gives you statistics on how many clicks it has and if it’s shared on Twitter and what not.
There’s really nothing extraordinary about it, in fact it’s quite simple. Put a long URL in the input field and hit “OK”. You’ll get the shortened URL back in the same input field.
NOTE! The screenshots is showing the Swedish translation but the interface is orginally in English.
Shortening a long URL
The shortened URL
To use the application you will of course need a Bit.ly account. The first time Bitlyfier is launched it will ask for your Bit.ly account settings. Just fill in your username and API key (it’s found on your account page at http://bit.ly/account).
Bitlyfier account settings
For the hacker you, Bitlyfier can also be used as a command line tool. These are the options:
NOTE! You should quote the value of the ‘-s’ flag. If the URL to be shortened
contains a querystring with ampersands the URL will be truncated if it’s not
So to shorten a long URL do like:
user@machine:~$ bitlyfier -n -s "http://domain.com/long/url/to/shorten"
The Bitly API class I’ve written can of course be used standalone (it’s located in
src/bitly.vala in the sources package downloadable below). Here’s an example of usage:
More about the Bit.ly API and what the API methods do can be read about at http://bit.ly/6HIqjS.