2017-03-13 19:13:58 +00:00
|
|
|
import setuptools, pyshorteners
|
2017-03-13 18:59:25 +00:00
|
|
|
|
|
|
|
def shortURL(url):
|
|
|
|
try:
|
|
|
|
pyshorteners.Shortener('Google', api_key=setuptools.getSetting("Google", "googl")).short(url)
|
|
|
|
except pyshorteners.exceptions.ShorteningErrorException as e:
|
|
|
|
print("Error handling %s" % url)
|
|
|
|
raise
|