Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- consumer = OAuth::Consumer.new(
- CONSUMER_KEY, SECRET_KEY,
- :site => "https://www.tumblr.com/",
- :access_token_path => "/oauth/access_token",
- :http_method => :post,
- )
- access_token = consumer.get_access_token(
- nil, {},
- :x_auth_mode => 'client_auth',
- :x_auth_username => EMAIL,
- :x_auth_password => PASSWORD,
- )
- print "got token, sending request... "
- response = access_token.post(
- "http://api.tumblr.com/v2/blog/#{BLOG_URL}/post",
- "generator" => "tumbl.rb",
- "type" => "photo",
- "private" => "0",
- "slug" => "",
- "state" => "",
- "tags" => file.tags,
- "data" => File.open(file.name, "rb").read.force_encoding('ASCII-8BIT'),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement