diff --git a/googletools/__init__.py b/googletools/__init__.py new file mode 100644 index 0000000..3a72083 --- /dev/null +++ b/googletools/__init__.py @@ -0,0 +1,8 @@ +import 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