Skip to content

Instantly share code, notes, and snippets.

@posaunehm
Created February 24, 2013 16:19
Show Gist options
  • Select an option

  • Save posaunehm/5024398 to your computer and use it in GitHub Desktop.

Select an option

Save posaunehm/5024398 to your computer and use it in GitHub Desktop.
get youroom timeline using xauth.
# -*- 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