Created
June 16, 2013 19:10
-
-
Save kreeger/5793042 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
require 'oauth' | |
require 'uri' | |
key = '' | |
secret = '' | |
consumer = OAuth::Consumer.new(key, secret, { site: 'http://www.tumblr.com' }) | |
request_token = consumer.get_request_token(exclude_callback: true) | |
puts request_token.authorize_url | |
result = gets.chomp | |
uri = URI.parse(result) | |
verifier = Hash[uri.query.split('&').map { |el| el.split('=') }]['oauth_verifier'] | |
oauth_token = request_token.get_access_token(oauth_verifier: query['oauth_verifier']) | |
puts oauth_token.token | |
puts oauth_token.secret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment