File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ # URL Shortener
2
+
3
+ This script provides a shortened URL on the command line.
4
+
5
+ ## Requirement for this script:
6
+
7
+ 1 . pyshorteners
8
+
9
+ install it by running the following command in the command prompt:
10
+
11
+ pip install pyshorteners
12
+
13
+ ## How to use this script?
14
+
15
+ Just type the following in your command prompt:
16
+
17
+ python script.py
18
+
19
+ ## Sample of the script in action:
20
+
21
+ ![ demo] ( https://user-images.githubusercontent.com/56690856/96848723-69df4800-1472-11eb-850e-aad8064eaf5e.png )
Original file line number Diff line number Diff line change
1
+ pyshorteners
Original file line number Diff line number Diff line change
1
+ #import pyshorteners library
2
+ import pyshorteners
3
+
4
+ # input URL
5
+ url = input ("Enter the URL:" )
6
+
7
+ # class object
8
+ shortener = pyshorteners .Shortener ()
9
+
10
+ # shortened URl
11
+ urlShort = shortener .tinyurl .short (url )
12
+
13
+ # print shortened URL
14
+ print ("The shortened URL is:" + urlShort )
You can’t perform that action at this time.
0 commit comments