Skip to content

Instantly share code, notes, and snippets.

@ThisIsNoahEvans
Created June 13, 2020 18:56
Show Gist options
  • Save ThisIsNoahEvans/dbee2c8dcfe691e013b884f70523a2f5 to your computer and use it in GitHub Desktop.
Save ThisIsNoahEvans/dbee2c8dcfe691e013b884f70523a2f5 to your computer and use it in GitHub Desktop.
Link shortener
import requests
import json
longLink = input('')
res = requests.post('https://api.short.cm/links', {
'domain': 'go.itsnoahevans.co.uk',
'originalURL': longLink,
}, headers = {
'authorization': 'API'
}, json=True)
res.raise_for_status()
link = res.json()
link = (link['secureShortURL'])
print(link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment