How to convert long urls to short urls??

I have an application to bang my head for couple of days. It has to
convert the long urls to be converted to short urls like the ones in
rubyurl.com .

http://groups.google.com/group/rubyonrails-spinoffs/browse_frm/thread/ceb93da8e02b3253/#

tip: Google custom search engines

http://www.rorsearch.net/
http://google.com/coop/cse?cx=017013772762218702305%3A6lu0y9asqjc
http://www.google.com/coop/cse?cx=002948281758277548023%3Aup03slaclwa
http://vinsol.com/railssearch.html

google hurl. It's an open source tinyurl implementation in ruby (using
camping framework)

www.hurl.it i think...