twitools/googletools/__init__.py
Klaus-Uwe Mitterer 023b6fda64 Add missing import
2017-03-13 20:13:58 +01:00

9 lines
260 B
Python

import setuptools, pyshorteners
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