Skip to content

Instantly share code, notes, and snippets.

@mataki
Created July 15, 2010 02:05
Show Gist options
  • Save mataki/476393 to your computer and use it in GitHub Desktop.
Save mataki/476393 to your computer and use it in GitHub Desktop.
youRoom xauth sample
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 => "your_account@example.com",
: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