If you’re a Twitter user, you’ve probably discovered that sharing a URL to a favorite website isn’t necessarily the easiest thing in the world. That’s because Twitter posts are limited to 140 characters, while a common URL can easily pass 50 characters, if not more. Because of this, many Twitter clients have implemented URL shortening services that allow you to shorten your URL with ease.
Some of the common services used are bit.ly, tinyurl.com and is.gd (but there are dozens available). To use these services, you simply go to the web page, paste or type in the URL you want shortened, and the service spits out a URL for you. As an example, let’s look at the following:
That’s a URL to OMGUbuntu, a website/blog dedicated to software, themes and whatnot related to Ubuntu, a popular “brand” of Linux. The URL in question is also 50 characters long, which would leave your Twitter post to not a whole lot more than “You should really check out the following OMGUbuntu post: http://omgubuntu.co.uk/2010/03/dichotomy-ubuntu-ambiance-redux/” (that ended up being 121 characters, without the quotes). With a URL shortening service, on the other hand, such as is.gd, you would get the following URL:
Now you could post something like the following on Twitter: “Check out this post on OMGUbuntu. It’s a new theme that adds purple highlights to the new Lucid theme. Pretty cool. http://is.gd/fbeRH”
Even with all the extra information about what you’ve linked to, you still have a couple characters to spare.
Of course, not every Twitter client has URL shortening built into it, and URL shortening has other uses besides Twitter. So I was pretty happy when I saw a link to a program called “surl” that can shorten any URL, using a wide variety of URL shortening services, directly from the commandline. It’s simple!
Let’s say you wanted to shorten the URL above (the long one), using the tinyurl.com shortening service. You would type in the following:
surl -c http://omgubuntu.co.uk/2010/03/dichotomy-ubuntu-ambiance-redux/ -s tinyurl.com
“surl” calls up the program
“-c” followed by the original URL tells surl the URL you want shortened
“-s” followed by tinyurl.com (or any other service surl supports), is the shortening service you want to use
After a bit, surl spits out a single line of text: http://tinyurl.com/27pkwss
Now just send the shortened link to a friend, and when they click it, they’re immediately taken to the original URL. As you can see, surl is simple to use, and it supports a ton of different URL shortening services. Close to 40 of them, in fact.
And there’s a lot more surl can do. It supports usernames for services which require it, as well as API keys. You can get shortened URLs for a number of long URLs and have the output saved as a file, or just as a list of links. Be sure to check out the help system available:
This probably isn’t a program I’ll use constantly. For one, emailing long links isn’t a big deal, and many Twitter programs have similar functionality already available. But as a Linux user who often has a Terminal already open, I like the option of getting a shortened URL the geeky way. If that appeals to you as well, be sure to check out surl.