Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions BasicPythonScripts/URL_Shortener/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<h1 align="left">URL Shortner</h1>
It shortens the website URL.

## How to run the script
-Download the library using command **pip install pyshorteners** in command prompt.

## How it works
- It takes the website URL as input.
- It shortens the given URL and returns the shortened URL.

# Url Shortener

Long URLs are not easy to handle so URLs should be short and sweet so that they are easy to share.

**pyshorteners** is a Python lib to help you short and expand urls using URL Shorteners available.

6 changes: 6 additions & 0 deletions BasicPythonScripts/URL_Shortener/code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pyshorteners #library in python for shortening URL
def shorten(url):
return pyshorteners.Shortener().tinyurl.short(url) ## shortening the URL

url = input("Enter URL: ") #takes input(URL) from the user
print("Shortened URL : ", shorten(url)) #returns output