Created
December 24, 2014 04:22
-
-
Save gone/bd6f846aa8c264202dc4 to your computer and use it in GitHub Desktop.
This file contains 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
import base64 | |
import requests | |
import requests_oauthlib | |
TUMBLR_CONSUMER_KEY="UP4UIWi2OUAGVBzbpHMAuNYc3TYBWaR0RVQ4HBfBG3xqT9xmiR" | |
TUMBLR_CONSUMER_SECRET="Kxdch4r0VKCH7rDaMfgybAWnu1Yo8JAFa67prxMXCBIvzHgQmn" | |
TUMBLR_OAUTH_TOKEN="l4YrLmrR4TfrR7ACD1UEKLUYMxGMHJ9WEPS9UHjgCaoj0wOyGk" | |
TUMBLR_OAUTH_TOKEN_SECRET="vq8AytX1ws734DKfWfrNiJgW8dwBljjUIOiZoZM3A8i0hlbEAS" | |
auth = requests_oauthlib.OAuth1Session(TUMBLR_CONSUMER_KEY, | |
client_secret=TUMBLR_CONSUMER_SECRET, | |
resource_owner_key=TUMBLR_OAUTH_TOKEN, | |
resource_owner_secret=TUMBLR_OAUTH_TOKEN_SECRET) | |
x = auth.post("https://api.tumblr.com/v2/blog/omni5cience.tumblr.com/post", { | |
'format': 'html', | |
'state': 'draft', | |
'caption': 'Caption!', | |
'type': 'video', | |
'data': base64.b64encode(open('./6651fe47-e9db-4df2-b809-6c942315cb16.mp4', 'rb').read()) | |
}) # tmp file locations are weird on OS X | |
import ipdb; ipdb.set_trace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment