fixed bug with https

This commit is contained in:
neersighted 2012-03-06 23:10:40 -08:00
parent 51c2d2693b
commit 11c5005158

View file

@ -16,6 +16,8 @@ class ShortenError(Exception):
def bitly(url, user, apikey):
try:
if url[:7] != "http://":
if url[:8] == "https://":
url = url
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)