Created
February 24, 2013 16:19
-
-
Save posaunehm/5024398 to your computer and use it in GitHub Desktop.
get youroom timeline using xauth.
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
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'oauth' | |
| require 'JSON' | |
| user = 'user' | |
| pass = 'pass' | |
| key = 'consumer_key' | |
| secret = 'consumer_secret' | |
| # get access token using XAuth | |
| # ref:https://gist.github.com/maraigue/304123 | |
| consumer = OAuth::Consumer.new(key, secret, :site => "https://www.youroom.in/") | |
| access_token = consumer.get_access_token(nil, {}, { | |
| :x_auth_mode => "client_auth", | |
| :x_auth_username => user, | |
| :x_auth_password => pass, | |
| }) | |
| # get user timeline | |
| res = access_token.get("https://www.youroom.in/?format=json") | |
| puts JSON.parse(res.body) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment