anirudh06 commited on
Commit
6763efd
·
1 Parent(s): fea5cf7

app.py file created

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pyshorteners
3
+
4
+ def shorten_url(url):
5
+ shortener = pyshorteners.Shortener()
6
+ short_url = shortener.tinyurl.short(url)
7
+ return short_url
8
+
9
+ def url_shortener(url):
10
+ short_url = shorten_url(url)
11
+ return short_url
12
+
13
+ iface = gr.Interface(fn=url_shortener, inputs="text", outputs="text", title="URL Shortener")
14
+ iface.launch()