amazon_auth 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/README.md +22 -2
- data/amazon_auth.gemspec +1 -1
- data/lib/amazon_auth.rb +1 -0
- data/lib/amazon_auth/capybara.rb +3 -0
- data/lib/amazon_auth/client.rb +2 -1
- data/lib/amazon_auth/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435ea0526c11b6d7fe4cbba0d6ebe7e552a998f3
|
4
|
+
data.tar.gz: 2365efdd3b8eb344ba290261b7b4fd12acbd97eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0dd506e3afcecc1788fd3fb1920cec2df9204709961ddfb96399f03ac1732ec940d97d1fd78bde7d7e357117eebbd6a6ba2a94a15fdc00b58fdd61e29fa2a5
|
7
|
+
data.tar.gz: b3983393dd83beca479aa6313ab7623d45e2a0f9b0e634c0089a533713ad0a14ee5f04059dc28cec5c1518b165b179c79a3f843a0a54567906d0f573d859a00e
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# AmazonAuth
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/amazon_auth.svg)](https://badge.fury.io/rb/amazon_auth)
|
3
4
|
[![Build Status](https://travis-ci.org/kyamaguchi/amazon_auth.svg?branch=master)](https://travis-ci.org/kyamaguchi/amazon_auth)
|
4
5
|
|
5
6
|
Sign In Amazon using Capybara and Selenium
|
@@ -31,9 +32,11 @@ Don't forget to disable automatic updates of Firefox.
|
|
31
32
|
|
32
33
|
You may also need geckodriver.
|
33
34
|
This may need to be older depending on the version of selenium-webdriver.
|
34
|
-
|
35
|
+
|
35
36
|
[Download geckodriver](https://github.com/mozilla/geckodriver/releases)
|
36
37
|
|
38
|
+
If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
|
39
|
+
|
37
40
|
## Usage
|
38
41
|
|
39
42
|
### Set Amazon credentials on your local machine
|
@@ -65,12 +68,29 @@ client.session.all('a').find{|e| e['href'] =~ %r{/gp/digital/fiona/manage/} }.cl
|
|
65
68
|
client.driver.quit
|
66
69
|
```
|
67
70
|
|
68
|
-
### Use
|
71
|
+
### Use amazon site in different domain
|
69
72
|
|
70
73
|
Set `AMAZON_DOMAIN` in _.env_.
|
71
74
|
|
72
75
|
e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site
|
73
76
|
|
77
|
+
### Use Chrome (chromedriver)
|
78
|
+
|
79
|
+
You can use Chrome instead of Firefox
|
80
|
+
|
81
|
+
Before running, you need to download chromedriver.
|
82
|
+
Please download latest chromedriver_xxx.zip from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
|
83
|
+
|
84
|
+
```
|
85
|
+
mv ~/Downloads/chromedriver /usr/local/bin/
|
86
|
+
```
|
87
|
+
|
88
|
+
In console,
|
89
|
+
|
90
|
+
```
|
91
|
+
client = AmazonAuth::Client.new(driver: :chrome)
|
92
|
+
```
|
93
|
+
|
74
94
|
## Development
|
75
95
|
|
76
96
|
Some features come from https://github.com/kyamaguchi/kindle
|
data/amazon_auth.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_runtime_dependency 'capybara'
|
23
|
-
spec.add_runtime_dependency 'selenium-webdriver'
|
23
|
+
spec.add_runtime_dependency 'selenium-webdriver'
|
24
24
|
spec.add_runtime_dependency 'highline'
|
25
25
|
spec.add_runtime_dependency 'dotenv'
|
26
26
|
spec.add_runtime_dependency 'activesupport'
|
data/lib/amazon_auth.rb
CHANGED
data/lib/amazon_auth/client.rb
CHANGED
@@ -18,6 +18,7 @@ module AmazonAuth
|
|
18
18
|
raise('AMAZON_PASSWORD_CODE is required.')
|
19
19
|
end
|
20
20
|
end
|
21
|
+
@driver = options.fetch(:driver, :selenium)
|
21
22
|
end
|
22
23
|
|
23
24
|
def sign_in
|
@@ -63,7 +64,7 @@ module AmazonAuth
|
|
63
64
|
end
|
64
65
|
|
65
66
|
def session
|
66
|
-
@session ||= Capybara::Session.new(
|
67
|
+
@session ||= Capybara::Session.new(@driver)
|
67
68
|
end
|
68
69
|
|
69
70
|
def driver
|
data/lib/amazon_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuho Yamaguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: highline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- exe/amazon_auth
|
158
158
|
- lib/amazon_auth.rb
|
159
159
|
- lib/amazon_auth/amazon_info.rb
|
160
|
+
- lib/amazon_auth/capybara.rb
|
160
161
|
- lib/amazon_auth/client.rb
|
161
162
|
- lib/amazon_auth/converter.rb
|
162
163
|
- lib/amazon_auth/version.rb
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
181
|
version: '0'
|
181
182
|
requirements: []
|
182
183
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.6.
|
184
|
+
rubygems_version: 2.6.11
|
184
185
|
signing_key:
|
185
186
|
specification_version: 4
|
186
187
|
summary: Login amazon.
|