Goo.gl URL shortener

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import urllib
import json


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

More like this

  1. Bit.ly url shortener by BluePeppers 2 years, 5 months ago
  2. A custom URL shortening view, for use with rev=canonical by simon 4 years, 1 month ago
  3. Google Contacts API friend finder by dgouldin 5 years, 1 month ago
  4. Create short URL redirects for site urls. by matt.geek.nz 4 years, 3 months ago
  5. Expire page from cache by mattgrayson 4 years, 9 months ago

Comments

(Forgotten your password?)