1. Dan Buch
  2. TinyUrl

Overview

The TinyUrl package provides a few useful functions for use from within python code:

>>> import tinyurl
>>> tinyurl.create_one('http://google.com/')
'http://tinyurl.com/8kp'

>>> for u in tinyurl.create('http://google.com/', 'http://meatballhat.com/'):
...    print u
...
http://tinyurl.com/8kp
http://tinyurl.com/7qg8g7

Additionally, a command-line interface is provided for general use, as in shell scripts or <whatever>...

$ export GOOGLE_URL="`tinyurl http://google.com/`"
$ echo $GOOGLE_URL
http://tinyurl.com/8kp

Much love to the folks at tinyurl.com!