KindleManager

Gem Version Build Status

Scrape information of kindle books from amazon site

Fetch Kindle Books information

kindle_manager_fetch

Load books information

kindle_manager_load_books Recorded with Recordit

Installation

Add this line to your application's Gemfile:

gem 'kindle_manager'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kindle_manager

Usage

Setup

chromedriver is required. Please download chromedriver and update chromedriver regularly.

Create .env following the instructions of https://github.com/kyamaguchi/amazon_auth

amazon_auth

vi .env

And Dotenv.load or gem 'dotenv-rails' may be required when you use this in your app.

Run

In console

require 'kindle_manager'
client = KindleManager::Client.new(debug: true, limit: 1000)
client.fetch_kindle_list

books = client.load_kindle_books

client.quit

Once fetch_kindle_list succeeds, you can load books information of downloaded pages anytime. (You don't need to fetch pages with launching browser every time.)

client = KindleManager::Client.new
books = client.load_kindle_books

Options

Debug print: client = KindleManager::Client.new(debug: true)

Limit fetching with number of fetched books: client = KindleManager::Client.new(limit: 100)

Change sleep duration on scrolling (default 3 seconds): client = KindleManager::Client.new(fetching_interval: 5)

Change max scroll attempts (default 20): client = KindleManager::Client.new(max_scroll_attempts: 30)

Renew the directory for downloading: create: true

Options of amazon_auth gem

Firefox: driver: :firefox

Login and password: login: 'xxx', password: 'yyy'

Applications

Applications using this gem

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kyamaguchi/kindle_manager.

License

The gem is available as open source under the terms of the MIT License.