9 lines
267 B
Python
9 lines
267 B
Python
import setuptools, pyshorteners
|
|
|
|
def shortURL(url):
|
|
try:
|
|
return pyshorteners.Shortener('Google', api_key=setuptools.getSetting("Google", "googl")).short(url)
|
|
except pyshorteners.exceptions.ShorteningErrorException as e:
|
|
print("Error handling %s" % url)
|
|
raise
|