Created
July 15, 2010 02:05
-
-
Save mataki/476393 to your computer and use it in GitHub Desktop.
youRoom xauth sample
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 "rubygems" | |
require "oauth" | |
consumer_key = "consumer_key" | |
consumer_secret = "consumer_secret" | |
consumer = OAuth::Consumer.new(consumer_key, | |
consumer_secret, | |
:site => "https://www.youroom.in/") | |
access_token = consumer.get_access_token(nil, {}, { | |
:x_auth_mode => "client_auth", | |
:x_auth_username => "[email protected]", | |
:x_auth_password => "your_password", | |
}) | |
access_token.secret # => "your_access_token" | |
access_token.token # => "your_access_secret" | |
resp = access_token.get('https://www.youroom.in/?format=json') | |
begin | |
pp JSON.parse(resp.body) | |
rescue | |
puts resp.body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment