Created
August 8, 2010 14:34
-
-
Save superbrothers/514094 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'rubygems' | |
require 'oauth/consumer' | |
OAuth::VERSION = 1.0 | |
print 'Consumer Key > '; consumer_key = gets.chomp.strip | |
print 'Consumer Secret > '; consumer_secret = gets.chomp.strip | |
consumer = OAuth::Consumer.new(consumer_key, consumer_secret, | |
{:site => "https://api.login.yahoo.com", | |
:request_token_path => "/oauth/v2/get_request_token", | |
:authorize_path => "/oauth/v2/request_auth", | |
:access_token_path => "/oauth/v2/get_token"}) | |
request_token = consumer.get_request_token | |
puts "authorize URL: #{request_token.authorize_url}" | |
print 'oauth_verifier(code) > '; oauth_verifier = gets.chomp.strip | |
access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier) | |
puts "access token: #{access_token.token}" | |
puts "access secret: #{access_token.secret}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment