Goo.gl URL shortener

How to make shorten url using goo.gl

import urllib
import simplejson

def GooGL(url):
    params = urllib.urlencode({'security_token': None, 'url': url})
    f = urllib.urlopen('http://goo.gl/api/shorten', params)
    return simplejson.loads(f.read())['short_url']
>>> GooGL('http://www.google.com')
'http://goo.gl/mR2d'
>>>



coded by nessus