File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
BasicPythonScripts/URL_Shortener Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ <h1 align =" left " >URL Shortner</h1 >
2
+ It shortens the website URL.
3
+
4
+ ## How to run the script
5
+ -Download the library using command ** pip install pyshorteners** in command prompt.
6
+
7
+ ## How it works
8
+ - It takes the website URL as input.
9
+ - It shortens the given URL and returns the shortened URL.
10
+
11
+ # Url Shortener
12
+
13
+ Long URLs are not easy to handle so URLs should be short and sweet so that they are easy to share.
14
+
15
+ ** pyshorteners** is a Python lib to help you short and expand urls using URL Shorteners available.
16
+
Original file line number Diff line number Diff line change
1
+ import pyshorteners #library in python for shortening URL
2
+ def shorten (url ):
3
+ return pyshorteners .Shortener ().tinyurl .short (url ) ## shortening the URL
4
+
5
+ url = input ("Enter URL: " ) #takes input(URL) from the user
6
+ print ("Shortened URL : " , shorten (url )) #returns output
You can’t perform that action at this time.
0 commit comments