All Projects → speric → Kindle Highlights

speric / Kindle Highlights

Licence: mit
Get your Kindle highlights.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Kindle Highlights

Kindleclippings
Extract kindle highlights into organised text files
Stars: ✭ 24 (-94.88%)
Mutual labels:  kindle, books, reading
awesome-reading
Notes from some books that I've read.
Stars: ✭ 43 (-90.83%)
Mutual labels:  books, reading
Readteractive
Tool for writing and generating interactive books.
Stars: ✭ 23 (-95.1%)
Mutual labels:  kindle, reading
Mastering-Algorithms-with-C
This repository contains example files organized by chapters in Mastering Algorithms with C, by Kyle Loudon
Stars: ✭ 48 (-89.77%)
Mutual labels:  books, reading
Awesome Ai Books
Some awesome AI related books and pdfs for learning and downloading, also apply some playground models for learning
Stars: ✭ 855 (+82.3%)
Mutual labels:  books, reading
Book Notes
Notes from books and other interesting things that I've read. Table of contents at the end 👇
Stars: ✭ 2,636 (+462.05%)
Mutual labels:  books, reading
good-reads
List of inspiring articles, blogs, tutorials and books. Tech stuff.
Stars: ✭ 14 (-97.01%)
Mutual labels:  books, reading
Annual-Reading-List
A list of things to read every year.
Stars: ✭ 124 (-73.56%)
Mutual labels:  books, reading
reading-list
My reading list
Stars: ✭ 15 (-96.8%)
Mutual labels:  books, reading
point-us-to-a-book
📚 reading list
Stars: ✭ 50 (-89.34%)
Mutual labels:  books, reading
Bookwyrm
Social reading and reviewing, decentralized with ActivityPub
Stars: ✭ 483 (+2.99%)
Mutual labels:  books, reading
book-sentences
A collection of sentences from different books.
Stars: ✭ 43 (-90.83%)
Mutual labels:  books, reading
bookwyrm
Social reading and reviewing, decentralized with ActivityPub
Stars: ✭ 1,499 (+219.62%)
Mutual labels:  books, reading
Gen2Kindle
Search, download, convert and send files directly to your kindle from Libgen in one place.
Stars: ✭ 21 (-95.52%)
Mutual labels:  books, kindle
notes
📖 What I'm reading lately
Stars: ✭ 85 (-81.88%)
Mutual labels:  books, reading
ReaDB
ReaDB is your private digital bookshelf. Read. Review. Remember.
Stars: ✭ 84 (-82.09%)
Mutual labels:  books, reading
Ultimate Resources Zh Hans
电子书、软件、Chrome 扩展、网站等推荐。
Stars: ✭ 325 (-30.7%)
Mutual labels:  books
Epub Press Clients
📦 Clients for building books with EpubPress.
Stars: ✭ 370 (-21.11%)
Mutual labels:  kindle
Books
📚 Books worth reading
Stars: ✭ 330 (-29.64%)
Mutual labels:  books
Full Speed Python
Full Speed Python: a book for self-learners
Stars: ✭ 3,447 (+634.97%)
Mutual labels:  books

kindle-highlights

build status

A Ruby gem for collecting your Kindle highlights.

Requirements

  • Ruby 2.1.0 or greater
  • An Amazon Kindle account

Install

gem install kindle-highlights

Use

First, require the gem and initialize a new client by passing in the email address & password you use to sign into your Amazon Kindle account:

require 'kindle_highlights'

kindle = KindleHighlights::Client.new(
  email_address: "[email protected]",
  password: "password"
)

Fetching a list of your Kindle books

Use the books method to get a listing of all your Kindle books. This method returns a collection of KindleHighlights::Book objects:

kindle.books
#=>
[
  <KindleHighlights::Book:
      @asin="B000XUAETY",
      @author="James R. Mcdonough",
      @title="Platoon Leader: A Memoir of Command in Combat"
  >,
  <KindleHighlights::Book:
    @asin="B003XDUCEU",
    @author="Michael Lopp",
    @title="Being Geek: The Software Developer's Career Handbook"
  >,
  <KindleHighlights::Book:
    @asin="B00JJ1RIO2",
    @author="James K. A. Smith",
    @title="How (Not) to Be Secular: Reading Charles Taylor"
  >
]

Each Book object has it's asin, author, and title as attributes:

book = kindle.books.first
book.asin
#=> "B000XUAETY"
book.author
#=> "James R. Mcdonough"
book.title
#=> "Platoon Leader: A Memoir of Command in Combat"

Fetching all highlights for a single book

To get only the highlights for a specific book, use the highlights_for method, passing in the book's Amazon ASIN as the only method parameter. This method returns a collection of KindleHighlights::Highlight objects:

kindle.highlights_for("B005CQ2ZE6")
#=>
[
  <KindleHighlights::Highlight:0x007fc4e7e03ea0
    @asin="B005CQ2ZE6",
    @text="One of the most dangerous things you can believe in this world is that technology is neutral.",
    @location="197"
  >
]

Each Highlight object has the book's asin, the text of the highlight, and it's location as attributes:

highlight = kindle.highlights_for("B005CQ2ZE6").first

highlight.asin
#=> "B005CQ2ZE6"
highlight.text
#=> "One of the most dangerous things you can believe in this world is that technology is neutral."
highlight.location
#=> "197"

Additionally, each book has it's own highlights_from_amazon method:

book = kindle.books.first
book.highlights_from_amazon

Advanced Usage

This gem uses mechanize to interact with Amazon's Kindle pages. You can override any of the default mechanize settings (see lib/kindle_highlights/client.rb) by passing your settings to the initializer:

kindle = KindleHighlights::Client.new(
  email_address: "[email protected]",
  password: "amazon_password",
  mechanize_options: { user_agent_alias: 'Mac Safari' }
)

Or you can use read.amazon.com equivalents provided on other TLDs like:

kindle = KindleHighlights::Client.new(
  email_address: "[email protected]",
  password: "amazon_password",\
  root_url: 'https://read.amazon.co.jp'
)

A Note About CAPTCHAs

Amazon will sometimes issue a CAPTCHA challenge when logging in to your Kindle account. If this happens when the gem attempts to log in to your Kindle account to retrieve your book list or highlights, you'll get a KindleHighlights::Client::CaptchaError, like the following:

> kindle.books
KindleHighlights::Client::CaptchaError: Received a CAPTCHA while attempting to sign in to your Amazon account. You will need to resolve this manually at https://www.amazon.com/ap/signin?openid.pape.max_auth_age=0&openid...

There's no way to programmatically resolve this situation. The best solution I've found is to open a browser, visit the URL that the gem returns, log in to your Kindle account, and click around a bit. Then log out of your Kindle account and re-attempt to fetch your highlights via this gem. Additionally, you could try instantiating a new instance of the client and changing the User-Agent via mechanize_options like:

kindle = KindleHighlights::Client.new(
  email_address: "[email protected]",
  password: "amazon_password",
  mechanize_options: { user_agent_alias: 'iPhone' }
)

In The Wild

  • tobi/highlights - Download your Kindle highlights and email random ones to your inbox

Contributing to kindle-highlights (PRs welcome)

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for the feature/bugfix. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate it to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011-2018 Eric Farkas. See MIT-LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].