Created
September 13, 2011 18:08
-
-
Save johncrisostomo/1214545 to your computer and use it in GitHub Desktop.
bit.ly shortener cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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