Url-shortner2 / app.py
Last commit not found
raw
history blame
419 Bytes
import gradio as gr
import pyshorteners
def shorten_url(url):
shortener = pyshorteners.Shortener()
short_url = shortener.tinyurl.short(url)
return short_url
def url_shortener(url):
short_url = shorten_url(url)
return short_url
iface = gr.Interface(
fn=url_shortener,
inputs="text",
outputs=gr.Textbox(label="Shortened URL", copyable=True),
title="URL Shortener"
)
iface.launch()