fixed bug with https
This commit is contained in:
parent
51c2d2693b
commit
11c5005158
|
@ -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)
|
||||
|
|
Reference in a new issue