I thought about writing how I made Baconfile's tiny URL service, tinyb.cn. However, I thought it would be more fun to write a generic URL shortener... and make it short. I've been wanting to play around with Sinatra (a Ruby web framework that isn't Rails) for a while now, so that's what I did.
Here it is: Tiny Tiny URL
This is my first Ruby code ever, so please be nice.
The basic idea is to have the user enter a URL, then store that URL in the database. The only columns in the database are the auto-incrementing primary key and the URL. To create fancy short URLs, the id is base36 encoded/decoded. That's all people.
