Get your Kindle highlights via Amazon's Kindle site
There's currently no Kindle API, so I built a scraper.
Required gems
- ruby-aaws
- Mechanize
The ruby-aaws gem assumes you have an Associates tracking code, and Product API credentials. A handy guide for setting up the ruby-aaws gem can be found at:
The kindle-highlights gem depends on the ruby-aaws gem to grab data about the product from which the highlight came, and will not work without ruby-aaws being set up properly.
Install
gem install kindle-highlights
Use
require 'kindle_highlights'
# to create a new KindleHighlight object, give it your Amazon email address and password
kindle = KindleHighlight.new("foo@bar.com", "password")
kindle.highlights.each do |highlight|
highlight.annotation_id # => a unique value for each highlight, generated by Amazon
highlight.content # => the actual highlight text
highlight.asin # => the Amazon ASIN for the highlight's product
highlight.author # => author of the book from which the highlight is taken
highlight.title # => title of the book from which the highlight is taken
end
Updates
- Added annotation_id to Highlight class (0.0.3)
- Added dependencies to Mechanize and ruby-aaws within gemspec (0.0.4)
- Cache AWS Product API results in a Hash, keyed on ASIN, to save time (0.0.5)
- Get Small response group from Amazon (0.0.5)
- Set
user_agent_alias = 'Mac Safari'
, refactored directory and naming structure (0.0.6)