Added .expand to get original URL from shortened URL
This commit is contained in:
parent
d5c81f6079
commit
f178ed33b6
|
@ -30,3 +30,12 @@ def shorten(inp, bot = None):
|
|||
if api_key is None:
|
||||
return "error: no api key set"
|
||||
return bitly(inp, api_user, api_key)
|
||||
|
||||
@hook.command
|
||||
def expand(inp, bot = None):
|
||||
".expand <url> - gets the original URL from a shortened link"
|
||||
try:
|
||||
url = http.get_url(inp)
|
||||
except HTTPError, e:
|
||||
return "Failed to expand URL."
|
||||
return url
|
||||
|
|
Reference in a new issue