Spaces:
Runtime error
Runtime error
app.py file created
Browse files
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()
|