This commit is contained in:
Luke Rogers 2014-03-06 14:02:26 +13:00
parent 141fe8d80c
commit f81cf21b57
10 changed files with 18 additions and 18 deletions

View file

@ -23,7 +23,7 @@ def isgd(url):
""" shortens a URL with the is.gd API """
url = urlnorm.normalize(url.encode('utf-8'), assume_scheme='http')
params = urllib.parse.urlencode({'format': 'json', 'url': url})
request = http.get_json("http://is.gd/create.php?%s" % params)
request = http.get_json("http://is.gd/create.php?{}".format(params))
if "errorcode" in request:
raise ShortenError(request["errorcode"], request["errormessage"])