Skip to content

Commit a188105

Browse files
authored
Create tiny-url-shortner.py
1 parent 47c06b2 commit a188105

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from requests import post
2+
3+
# requires API from tinyurl.com
4+
5+
def TinyShortner(big_url: str) -> str:
6+
"""
7+
Function short the big urls to tiny by Tiny Api
8+
"""
9+
return post("https://tinyurl.com/api-create.php", data={"url": big_url}).text
10+
11+
12+
if __name__ == "__main__":
13+
url = input("Enter the Big Url to short: ")
14+
print(TinyShortner(url))

0 commit comments

Comments
 (0)