Skip to content

Instantly share code, notes, and snippets.

@karanjagota
Created April 12, 2021 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karanjagota/fc7d810a1ea9c6025e40bded77338c39 to your computer and use it in GitHub Desktop.
Save karanjagota/fc7d810a1ea9c6025e40bded77338c39 to your computer and use it in GitHub Desktop.
# displaying API data
API_URL = 'https://cleanuri.com/api/v1/shorten'
st.subheader('URL SHORTNER')
_url = st.text_input('Enter URL')
pressed = st.button('Get Short Link')
if pressed:
if _url !='':
data = {'url': _url}
r = requests.post(API_URL, data=data)
st.write(r.json())
else:
st.write('Please enter the right URL first')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment