posted on 2010-09-14 - amd.im/QS2j
After toying a bit with yourls, I went looking for a way to get a URL shortener setup that was a bit less complicated and could be deployed on Heroku (a service that I have recently become totally enamored with). This is what I ended up with.
After a few Google searches I came across this posting by Andrew Pilsch. In the article he bluntly explains how to set up your own URL shortener and provides code for a Sinatra based URL shortener.
This seemed perfect, Sinatra was something that I have also been wanting to tinker with and this seemed like a good place to start.
The codebase provided was a good framework for what I wanted but didn't quite check all the boxes so I set out modifying it to be deployable to Heroku and to generate random short URLs (a la bit.ly) rather than the sequential ones that it had originally been configured for.
I posted my fork of the code on Github and have a running example at ➼.ws.
Check it out and let me know what you think. If you get it running somewhere else, let me know I'd love to see it.
amdavidson.com is a simple blog run by Andrew Davidson, a manufacturing engineer with a blogging habit. He sometimes posts 140 character tidbits, shares photos, and saves links. You can also see posts dating back to 2005.