README.md in amazon_auth-0.1.2 vs README.md in amazon_auth-0.1.3

- old
+ new

@@ -1,7 +1,9 @@ # AmazonAuth +[![Build Status](https://travis-ci.org/kyamaguchi/amazon_auth.svg?branch=master)](https://travis-ci.org/kyamaguchi/amazon_auth) + Sign In Amazon using Capybara and Selenium ## Installation Add this line to your application's Gemfile: @@ -18,22 +20,30 @@ $ gem install amazon_auth ## Requirements +This gem may not work with newer versions of Firefox. + Firefox (<= 47.0.2) -This may not work with newer versions of Firefox. +[Download Firefox](https://ftp.mozilla.org/pub/firefox/releases/) +Don't forget to disable automatic updates of Firefox. +You may also need geckodriver. +This may need to be older depending on the version of selenium-webdriver. +e.g. geckodriver v0.14.0 works with selenium-webdriver 3.2 +[Download geckodriver](https://github.com/mozilla/geckodriver/releases) + ## Usage ### Set Amazon credentials on your local machine [Quick] You can set login and password in console. -[Recommended] Or you can convert them to protect them against shoulder surfing. -Run `amazon_auth` and paste the output to _env_. +[Recommended] Or you can convert them to protect them against shoulder surfing. +Run `amazon_auth` and paste the output to _.env_. (`AMAZON_USERNAME_CODE` , `AMAZON_PASSWORD_CODE` and `AMAZON_CODE_SALT`) ### Run In console, you can move around pages using Capybara DSL @@ -44,29 +54,37 @@ # With credentials in .env client = AmazonAuth::Client.new # Sign in -page = client.sign_in +client.sign_in # Continue to the page for Kindle -page.first('a', text: 'コンテンツと端末の管理').click +client.session.all('a').find{|e| e['href'] =~ %r{/gp/digital/fiona/manage/} }.click # Close browser -page.driver.quit +client.driver.quit ``` +### Use amamzon site in different domain + +Set `AMAZON_DOMAIN` in _.env_. + +e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site + ## Development Some features come from https://github.com/kyamaguchi/kindle +Use _.env.development_ instead of _.env_ in development. + ``` git clone https://github.com/kyamaguchi/amazon_auth.git cd amazon_auth bundle ./exe/amazon_auth -vi .env +vi .env.development rspec ./bin/console ```