Skip to content

Instantly share code, notes, and snippets.

@derekg
derekg / post script
Created May 30, 2011 18:14
Simple Tumblr Posting Example
import urllib,sys
params = { 'email': 'derek@codecubed.com' , 'password' : 'SECRET PASSWORD'}
params['type'] = 'regular'
params['group'] = 'http://derek-test-06.tumblr.com'
params['title'] = 'I love tumblr'
params['body'] = 'and I love python'
cred = urllib.urlencode(params,True)
print urllib.urlopen('http://www.tumblr.com/api/write',cred).read()
@derekg
derekg / gist:1198576
Created September 6, 2011 18:44
Example of uploading photos to Tumblr w/ the V2 API # http://www.tumblr.com/docs/en/api/v2
import urllib,hmac,time,hashlib,base64,httplib,sys,json,urlparse
## This is just a simple example that is self contained.
## You will need to modified it to make it work
##
## creds - need to be filled out
## blognmae - needs to be defined
##
## reads in image files from the command line and posts to your blog

Keybase proof

I hereby claim:

  • I am derekg on github.
  • I am derekg (https://keybase.io/derekg) on keybase.
  • I have a public key ASAcZtA-jBQPDivxY6ACVrZyRg-SM6RIV5HPiSsA45cjTQo

To claim this, I am signing this object: