Skip to content

Commit e04c37f

Browse files
committed
Added files
1 parent 2825460 commit e04c37f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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

0 commit comments

Comments
 (0)