Skip to content

Instantly share code, notes, and snippets.

@andrew
Created November 13, 2011 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrew/1362774 to your computer and use it in GitHub Desktop.
Save andrew/1362774 to your computer and use it in GitHub Desktop.
Currently reading on goodreads
require 'faraday_middleware'
conn = Faraday.new(:url => 'http://www.goodreads.com') do |builder|
builder.use Faraday::Response::Mashify
builder.use Faraday::Response::ParseXml
builder.adapter Faraday.default_adapter
end
good_reads_key = 'your_key'
resp = conn.get "user/show/4714701.xml?key=#{good_reads_key}"
u = resp.body
currently_reading = u['GoodreadsResponse'].user.user_statuses.user_status.book
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment