{"id":13648481,"url":"https://github.com/lodestone/kindle","last_synced_at":"2025-08-18T11:33:44.338Z","repository":{"id":40791860,"uuid":"2044118","full_name":"lodestone/kindle","owner":"lodestone","description":"No Kindle Highlights API? Take control with this CLI!","archived":false,"fork":false,"pushed_at":"2018-04-30T13:33:46.000Z","size":396,"stargazers_count":90,"open_issues_count":1,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T01:11:32.003Z","etag":null,"topics":["amazon","cli","highlights","kindle","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lodestone.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.adoc","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.adoc","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-13T20:42:20.000Z","updated_at":"2023-09-05T07:57:04.000Z","dependencies_parsed_at":"2022-08-20T11:40:44.133Z","dependency_job_id":null,"html_url":"https://github.com/lodestone/kindle","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodestone%2Fkindle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodestone%2Fkindle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodestone%2Fkindle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodestone%2Fkindle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lodestone","download_url":"https://codeload.github.com/lodestone/kindle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248694162,"owners_count":21146944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","cli","highlights","kindle","ruby"],"created_at":"2024-08-02T01:04:17.376Z","updated_at":"2025-04-13T09:44:23.120Z","avatar_url":"https://github.com/lodestone.png","language":"Ruby","readme":"= Kindle Highlights for the Command Line\n:author: Matt Petty \u003cmatt@kizmeta.com\u003e\n:copyright: 2016\n\n:numbered!:\n\nNOTE: THIS IS NOT WORKING CURRENTLY, AS AMAZON CHANGED THEIR SITE\n\n+++\n\u003cimg src=\"http://link.nx.is/sWdP.png\" style=\"float:right;width:40%\" /\u003e\n+++\n\n== What is this?\n\nThe kindle highlights app gives **YOU** your kindle highlights without the poor interface Amazon has wrapped around _YOUR DATA_.\n\nIf you are like me, you make a lot of highlights while you read ebooks. I mark vocab words, great phrases, and inspirational sections.\n\nThe kindle command empowers you to actually _DO_ something with all those highlights you've been making on your Kindle and Kindle apps. The app downloads and caches your highlights. You can then get them in various formats like JSON, CSV, and a nice little Markdown format to run through pandoc or Marked app.\n\n**Specifically, you can:**\n\n* scrape and parse your kindle highlights and book data\n* keep your highlights stored _**locally**_\n* output in JSON format\n* output in CSV format\n* output in Markdown format\n* do sophisticated queries on your data using the `kindle console`\n\n**Future plans:**\n\n* automatic scanning for vocabulary words\n* output in other formats\n\n// TODO. What is this and why do you want to use it?\n\n== Installation\n\n```sh\ngem install kindle\n```\n\nThere are a lot of dependencies (including the latest Rails ActiveRecord v5), as this app is intended to provide a lot of conveniences and functionality over other lighter link:https://github.com/speric/kindle-highlights[libraries] like from our friend link:https://github.com/speric[@speric]! :heart:\n\n== Usage:\n\n=== Warnings and Caveats (HACKER ALERT)\n\nimage::http://i.perezhilton.com/wp-content/uploads/2014/12/hackers.gif[width=\"100%\"]\n\nLet's talk about passwords and security. Using the kindle command line app gives you the convenience to save your Amazon credentials in a file on your computer. This is probably bad. **Don't do it**. You've been warned.\n\nHax0rz *will* hack.\n\nIf, however, you intend to keep your password out of the settings file, you'll need to pass in the `--password=\u003csecret\u003e` argument every time. **Again: Be Forewarned**: Your shell is probably configured by default to save a history of what you type in. For that reason, you should be using something like the `zsh` option link:http://zsh.sourceforge.net/Doc/Release/Options.html[`HIST_IGNORE_SPACE`] to _\"hide\"_ your most-secretest commands.\n\n---\n\n=== Step 1: Initialization\n\n==== kindle init\n\nFirst you need to initialize the app with some default and/or customized settings, as well as create the database to store your highlights.\n\nTo initialize and save your password and username:\n\n```sh\n# Option 1\nkindle --username=\"change@your.email\" --password=\"yoursecret\" init\n```\n\n**OR**\n\nTo initialize with just a username:\n\n```sh\n# Option 2\nkindle --username=\"change@your.email\" init\n```\n\n**OR**\n\nJust run the `init` sub-command without any parameters, knowing you will just have to pass them in later. Every time.\n\n```sh\n# Option 3\nkindle init\n```\n\n\n---\n\n=== Step 2: Fetch your data\n\n==== kindle highlights update\n\nThe `update` sub-command uses either the passed in credentials or the saved credentials in the settings file and reaches out to Amazon's Kindle highlights website. It slurps all the highlights (and book info) and saves it in a SQLite3 database in `~/.kindle`.\n\n```sh\nkindle highlights update\n```\n\nThe `update` command will take a while to run, depending on how many highlights you have. Don't worry if it doesn't seem to do anything. That's okay. Trust in the UNIX-way.\n\n---\n\n=== Step 3: Output your data\n\n==== kindle highlights\n\nThe `highlights` command requires a sub-command to generate the appropriate output. Currently the available output formats are: JSON, CSV, and Markdown.\n\nExample with JSON:\n\n```sh\n# Output in json format and redirect to highlights.json file\nkindle highlights json \u003e highlights.json\n```\n\nExample with CSV:\n\n\n```sh\n# Output in csv format and redirect to highlights.csv file\nkindle highlights csv \u003e highlights.csv\n```\n\nExample with Markdown:\n\n```sh\n# Output in markdown format and redirect to highlights.md file\nkindle highlights markdown \u003e highlights.md\n```\n\n---\n\n== Advanced Topic: The Console\n\nimage::http://link.nx.is/1hbw6.png[]\n\nI've also included a `console` command for those of you familiar with Ruby on Rails, irb, etc. Issuing the `kindle console` command will open a console session with two ActiveRecord objects: `Book` and `Highlight`. These are real ActiveRecord v5.0 models pointing to the database of highlights.\n\nimage:http://link.nx.is/Qesb.png[width=\"100%\"]\n\n`kindle console` examples:\n\n```ruby\n\nKindle :) Book.count\n=\u003e 45\n\nKindle :) Highlight.count\n=\u003e 587\n\nKindle :) Highlight.first\n=\u003e #\u003cKindle::Models::Highlight:0x007fd43a50ae90\n id: 1,\n highlight: \"riparian\",\n amazon_id: nil,\n book_id: 1,\n created_at: 2016-07-01 00:18:32 UTC,\n updated_at: 2016-07-01 00:18:32 UTC\u003e\n\nKindle :) Book.first\n=\u003e #\u003cKindle::Models::Book:0x007fd43a591800\n id: 1,\n asin: \"B004J4WN0I\",\n title: \"Hounded (with two bonus short stories): The Iron Druid Chronicles, Book One\",\n author: \"by Kevin Hearne\",\n highlight_count: 8,\n created_at: 2016-07-01 00:18:32 UTC,\n updated_at: 2016-07-01 00:18:32 UTC\u003e\n\n```\n\n\n== Endcap\n\nIn case you are too lazy to open the LICENSE file, just FYI this is all MIT licensed.\n\n\n(C) 2012-2016 Matt Petty link:https://github.com/lodestone[@lodestone]\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodestone%2Fkindle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flodestone%2Fkindle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodestone%2Fkindle/lists"}