Create your own URL shortener, use it with Tweetie 2

I hate URL shorteners, but that’s not the point

I really hate short URLs; on both the giving and receiving end, either way I feel like I’m handing or being handed a package of confusion and uncertainty. But, unfortunately, they’re useful if you:

  • Are trying to send a link to someone and have limited space (Twitter)
  • Want to provide a URL that is long with lots of unique variables in it (Google Maps)
  • Need a URL you can easily tell people or have them write-down (during a presentation)

The confusion comes in if nobody takes the time to tell you what they’re handing you. Take Twitter for example, people who post a link usually give little context (“this is so cool: link” or “wow, I wish I had this: link”). Screw you guys! At least give me a hint as to what you’re handing me (other than yet another bit.ly or tinyurl link). Luckily, there are some mitigating factors:

  • Custom contextual short URLs: Flickr’s awesome flic.kr domain is a great start. If WordPress turned wp.me into the same for user’s posts, awesome. Even Posterous autolinks with their own post.ly. I know what kind of content is behind this domain.
  • URL expanders: Tweetie for Mac has a expander service built in for known shortener endpoints (click the bit.ly link and a popup tells you what the actual URL is). LongURL can be used to determine where a URL will really take you.
  • Smarter friends: don’t follow people or ask them to stop giving you contextless links (not likely)

So, with all that said, I want to roll my own URL shortener to tell people: trust me, I took the time to create my own service and hand-pick this URL for you to look at. Since I wrote about this, I’ll be sure to go the extra mile and make sure I give context when a shortened URL is necessary.

How to create your own URL shortener using Lessn

Shaun Inman has created a handy script and guide to create your own shortener: Lessn

The installation steps are simple if you know your way around a web server:

  1. Pick a short domain or sub-directory: you need to first figure out what domain you want to use (I chose devinr.com), you have to own it so you may use an existing domain and stick the shortener at a sub-directory (devinr.com/x/)
  2. Install the Lessn package: follow the README, but basically you just drag and drop the files using a FTP client (make sure you include the top-level .htaccess file, which is hidden by default in Finder on Mac OS X), setup the config file, and you’re done.
So now I immediately have my own bookmarklet, shortener endpoint (via API), etc. Now I can take it with me to Tweetie 2 for iPhone.

Setup Tweetie 2 for iPhone to use a custom URL shortener

Loren Brichter has done an great thing for his latest Twitter client (iTunes link): he allows you to have a custom URL shortener endpoint defined for use. In other words, every URL you post can be shortened using whatever service you want (including your own).
  1. Go buy and install the latest Tweetie 2 for iPhone
  2. Browse to the settings page (bottom of the accounts screen)
  3. Select URL shortener > Custom…
  4. Insert your endpoint using your API (so that Lessn returns plaintext to Tweetie): http://example.com/-/?url=%@&api=[Lessn API here]
It’s as simple as that. Now all your URLs in Tweetie can be auto-shortened using your own service. Neat.