Created
May 10, 2012 17:23
-
-
Save gthomas/2654567 to your computer and use it in GitHub Desktop.
Post to Tumblr
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
from tumblr import Api as Tumblr | |
#your tumblr credentials go here | |
BLOG = 'sweetpictures.tumblr.com' | |
#email address or username should work here | |
USER = '[email protected]' | |
PASSWORD = 'mysecurepassword' | |
#basically, log in to Tumblr | |
api = Tumblr(BLOG, USER, PASSWORD) | |
#here's how you'd post a photo from the web to your tumblr | |
image_url = "http://www.mycoolwebserver.com/images/photo_i_just_took.jpg" | |
api.write_photo(image_url) | |
#here's how you'd post one from the filesystem | |
image_path = "/Users/me/Desktop/picture.jpg" | |
api.write_photo(image_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment