-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (24 loc) · 822 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import requests as requestses
import ConfigX as Conf
def Url_Shortner(Full_Link,Link_Name):
Subadra = {"key": Conf.API_KEY, "short": Full_Link, "name": Link_Name}
Req = requestses.get(Conf.BASE_URL, params=Subadra)
Data = Req.json()
try:
title = Data['url']['title']
fullLink = Data['url']['fullLink']
date = Data['url']['date']
shortLink = Data['url']['shortLink']
print("Title: " + title);
print("Full Link: " + fullLink);
print("Date: " + date);
print("Shorted Link: " + shortLink);
except:
status = Data['url']['status']
print('Error Status: ', status);
Ful_Lin = input("Enter Your Link: ");
Lin_Nam = input("Enter Link Name: ");
print();
print();
Url_Shortner(Ful_Lin,Lin_Nam);
print();