Home
My Books
Browse ▾
Recommendations
Choice Awards
Genres
Giveaways
New Releases
Lists
Explore
News & Interviews
Genres
Art
Biography
Business
Children's
Christian
Classics
Comics
Cookbooks
Ebooks
Fantasy
Fiction
Graphic Novels
Historical Fiction
History
Horror
Memoir
Music
Mystery
Nonfiction
Poetry
Psychology
Romance
Science
Science Fiction
Self Help
Sports
Thriller
Travel
Young Adult
More Genres
Community ▾
Groups
Quotes
Ask the Author
Sign In
Join
Sign up
View profile
Profile
Friends
Groups
Discussions
Comments
Reading Challenge
Kindle Notes & Highlights
Quotes
Favorite genres
Friends’ recommendations
Account settings
Help
Sign out
Home
My Books
Browse ▾
Recommendations
Choice Awards
Genres
Giveaways
New Releases
Lists
Explore
News & Interviews
Genres
Art
Biography
Business
Children's
Christian
Classics
Comics
Cookbooks
Ebooks
Fantasy
Fiction
Graphic Novels
Historical Fiction
History
Horror
Memoir
Music
Mystery
Nonfiction
Poetry
Psychology
Romance
Science
Science Fiction
Self Help
Sports
Thriller
Travel
Young Adult
More Genres
Community ▾
Groups
Quotes
Ask the Author
Join Goodreads
and meet your next favorite book!
Sign Up Now
Sign in with Facebook
Goodreads Developers
discussion
really simple ruby oauth example
Created by
Michael Economy
, Oct 08, 2010
442 views
Michael Economy
#example authenticates and prints the raw xml for the friend updates.
require 'oauth'
key = BLAH #substitute your keys
secret = BLAH
consumer = OAuth::Consumer.new(key, secret, {:site => "
http://www.goodreads.com
"})
request_token = consumer.get_request_token
p request_token.authorize_url
#user needs to go to this url and approve it
access_token = request_token.get_access_token
p access_token.get("/updates/friends.xml").body
15 years ago
Chris
I was following the example at
http://www.goodreads.com/api/oauth_ex...
in irb which seems to have come out of this post.
I ran into an error (OAuth::VERSION not defined) and it seems that the require "oauth/consumer" should just be require "oauth".
13 years ago
Michael Economy
I've put the require in that example, thanks Chris.
13 years ago