Fixed (I hope) the same bug with https://

This commit is contained in:
neersighted 2012-03-07 09:37:37 -08:00
parent 11c5005158
commit 6749bf8340

View file

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