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