Spaces:
Runtime error
Runtime error
Shivraj8615
commited on
Commit
•
cb160fe
1
Parent(s):
46bed50
Upload 2 files
Browse filesfirst file commit
- streamlit_url_shortner.py +18 -0
- url_img.png +0 -0
streamlit_url_shortner.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pyshorteners
|
2 |
+
import streamlit as st
|
3 |
+
path = "/home/p/shiv/streamlit/url_img.png"
|
4 |
+
st.image(path)
|
5 |
+
heading = st.write("# URL Shortner")
|
6 |
+
st.header(heading)
|
7 |
+
|
8 |
+
input_url = st.text_input("")
|
9 |
+
|
10 |
+
if st.button('Submit'):
|
11 |
+
link = input_url
|
12 |
+
shorteners = pyshorteners.Shortener()
|
13 |
+
shortlink = shorteners.tinyurl.short(link)
|
14 |
+
st.write(shortlink)
|
15 |
+
else:
|
16 |
+
st.write("Write a proper link")
|
17 |
+
|
18 |
+
|
url_img.png
ADDED