Created
June 7, 2010 02:55
-
-
Save mataki/428164 to your computer and use it in GitHub Desktop.
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") | |
# Authentication by XAuth------------------------------ | |
access_token = consumer.get_access_token(nil, {}, { | |
:x_auth_mode => "client_auth", | |
:x_auth_username => "[email protected]", | |
:x_auth_password => "user_password", | |
}) | |
atoken = access_token.token # => | |
asecret = access_token.secret # => | |
# Access with saved token ------ | |
# access_token = OAuth::AccessToken.new(consumer, "access_token", "access_secret") | |
resp = access_token.get('https://www.youroom.in/r/6/entries.xml') # => #<Net::HTTPOK 200 OK readbody=true> | |
puts resp.body | |
# >> <?xml version="1.0" encoding="UTF-8"?> | |
# >> <entries type="array"> | |
# >> <entry> | |
# >> <content>Twitterのイノベーションの一つに、件名を無くしたことによる気軽さがあったように、youRoomでは、たしかルーム名が必須だったけど、waveみたいにルーム名なくてもルームの作成が出来るようになっても良いかもね。 @mat_aki #youroom</content> | |
# >> <created-at type="datetime">2010-06-06T13:30:08Z</created-at> | |
# >> <id type="integer">42440</id> | |
# >> <parent-id type="integer" nil="true"></parent-id> | |
# >> <root-id type="integer">42440</root-id> | |
# >> <updated-at type="datetime">2010-06-07T01:14:03Z</updated-at> | |
# >> <participation> | |
# >> <id type="integer">1267</id> | |
# >> <name>TwitterFetcher</name> | |
# >> </participation> | |
# >> </entry> | |
# >> ... | |
# >> </entries> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment