Skip to content

Instantly share code, notes, and snippets.

@johncrisostomo
Created September 13, 2011 18:08
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 johncrisostomo/1214545 to your computer and use it in GitHub Desktop.
Save johncrisostomo/1214545 to your computer and use it in GitHub Desktop.
bit.ly shortener cli
#!/usr/bin/env python
# URL SHORTENER CLI v0.01 by 4R5C4R105U5
# CREATED ON SEPT. 14, 2011
# GUI COMING SOON
import urllib
api = "" # I LEFT THIS BLANK ON PURPOSE
login = "" # LEFT BLANK ON PURPOSE AS WELL, USE YOUR OWN LOGIN AND API KEY! :D
user_url = raw_input('Enter url to be shortened : ')
shorten_url = "http://api.bitly.com/v3/shorten?login={0}&apiKey={1}&format=txt&longUrl={2}".format(login, api, user_url)
connect = urllib.urlopen(shorten_url)
print(connect.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment