fixed bug in shorten.py

This commit is contained in:
neersighted 2012-03-06 23:06:41 -08:00
parent 37a3cc2030
commit ac03ceb366

View file

@ -15,6 +15,8 @@ class ShortenError(Exception):
def bitly(url, user, apikey):
try:
if url[:7] != "http://":
url = "http://" + url
params = urlencode({'longUrl': url, 'login': user, 'apiKey': apikey, 'format': 'json'})
j = http.get_json("http://api.bit.ly/v3/shorten?%s" % params)
if j['status_code'] == 200: