Nov 10, 2018

Example of Tumblr photo post by API using Python

Tumblr API is very easy to use. Here is an example of Tumblr photo post by API using Python.
See also:

Example of Tumblr photo post by API using Java


'''
Created on Dec 28, 2014

@author: i88.ca
'''
import sys, pytumblr

if __name__ == '__main__':
    pass
client = pytumblr.TumblrRestClient(
    '<consumer_key>',
    '<consumer_secret>',
    '<oauth_token>',
    '<oauth_secret>',
)

client.create_photo('i88-ca', state="published", tags=["i88.ca", "goyun.info"], source=source=sys.argv[1], link="http://i88.ca")

Usage:

python tumblr.py my-image-url

You may need to install pytumblr
$ sudo -i easy_install pytumblr

See also:

How to install easy_install on Ubuntu