diff --git a/URL-Shortener/UrlShortener.py b/URL-Shortener/UrlShortener.py new file mode 100644 index 0000000..0a6360f --- /dev/null +++ b/URL-Shortener/UrlShortener.py @@ -0,0 +1,12 @@ +import pyshorteners +# for pyshorteners do (pip install pyshorteners) + + +def shorten_url(url): + shortener = pyshorteners.Shortener() + short_url = shortener.tinyurl.short(url) + return short_url + +if __name__ == "__main__": + url = input("Enter the URL to shorten: ") + print("Shortened URL:", shorten_url(url))