amazon_auth 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be42ef6936b600922637d6ff82740c6cb355b8574336ba18142729fbcd5ab394
4
- data.tar.gz: ec6d91bf0e702c892ae26e2d4edd5db2095bc6b322c78bc4b2dc3dd54f4a9beb
3
+ metadata.gz: 6ba25f9aeee6baa2987b8788859f81dd11f8d3b8c81d6320bef15fa7b0df47ea
4
+ data.tar.gz: 0b5443a962d8527a6d58083430dc923f80327a3efc655c9701b3b9b97004cb32
5
5
  SHA512:
6
- metadata.gz: ac1946c5930553fdee2febf9abd735eba70c033247edb679f2a06a4c16d8d309c7e97d03a0fbef6c69df7ccb05e9c06328e1985e7180e8636006a2374ef75a24
7
- data.tar.gz: ceb6c2bbb0d5f8cf37129ab9d906eadecfaf6b3db0efa5d15476901f2487d55ef25b195ddff73581590877e80030e328468056744ae310252b2256512a3362b7
6
+ metadata.gz: 2063595a48860cb43818b7e0be372039989fc9250ffae50276bc36d9ddd75844ec582cf65898ec0ec16cc9eb23e8990d416b2e619b509b554d51de2a99499e1a
7
+ data.tar.gz: d000ea349dbfe3e0127930a11d1f2aa35c0d9f71ec045b508771264cdfb19eee558bfd6d27babbcd684dd0289f7c68920d79adedf3e6829f61d0a1733e584b72
data/README.md CHANGED
@@ -70,6 +70,8 @@ envchain amazon rails console
70
70
  In console, you can move around pages using Capybara DSL
71
71
 
72
72
  ```ruby
73
+ require 'amazon_auth'
74
+
73
75
  # Without credentials in .env
74
76
  client = AmazonAuth::Client.new(login: 'your_amazon_email', password: 'your_amazon_password')
75
77
 
@@ -80,7 +82,7 @@ client = AmazonAuth::Client.new
80
82
  client.sign_in
81
83
 
82
84
  # Continue to the page for Kindle
83
- link = client.links_for('#navFooter a').find{|link| link =~ %r{/gp/digital/fiona/manage/} }
85
+ link = client.links_for('#navFooter a').find{|link| link =~ %r{/hz/mycd/myx} }
84
86
  client.session.visit link
85
87
  ```
86
88
 
@@ -94,14 +96,16 @@ e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site
94
96
 
95
97
  Using [capybara-sessionkeeper gem](https://github.com/kyamaguchi/capybara-sessionkeeper)
96
98
 
97
- ```
99
+ ```ruby
98
100
  client = AmazonAuth::Client.new(keep_cookie: true, debug: true)
101
+ client.sign_in
99
102
  ```
100
103
 
101
104
  You can change Capyabra.save_path when it isn't set
102
105
 
103
- ```
106
+ ```ruby
104
107
  client = AmazonAuth::Client.new(keep_cookie: true, save_path: 'tmp/cookies', debug: true)
108
+ client.sign_in
105
109
  ```
106
110
 
107
111
  ### Logging
@@ -122,7 +126,7 @@ client = AmazonAuth::Client.new(debug: true)
122
126
 
123
127
  In console,
124
128
 
125
- ```
129
+ ```ruby
126
130
  client = AmazonAuth::Client.new(driver: :firefox)
127
131
  ```
128
132
 
@@ -57,7 +57,12 @@ module AmazonAuth
57
57
 
58
58
  debug "Begin submit_signin_form"
59
59
  unless session.has_selector?('#signInSubmit')
60
- if session.has_selector?('input#continue') && session.has_selector?('input#ap_email')
60
+ if session.has_selector?('#continue input.a-button-input') && session.has_selector?('input#ap_email_login')
61
+ log "Found a form which asks only email (v2)"
62
+ session.fill_in 'ap_email_login', with: login
63
+ session.first('#continue input.a-button-input').click
64
+ # Maybe the following form is deprecated
65
+ elsif session.has_selector?('input#continue') && session.has_selector?('input#ap_email')
61
66
  log "Found a form which asks only email"
62
67
  session.fill_in 'ap_email', with: login
63
68
  session.first('input#continue').click
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuho Yamaguchi
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-09-28 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: capybara
@@ -178,7 +177,6 @@ homepage: https://github.com/kyamaguchi/amazon_auth
178
177
  licenses:
179
178
  - MIT
180
179
  metadata: {}
181
- post_install_message:
182
180
  rdoc_options: []
183
181
  require_paths:
184
182
  - lib
@@ -193,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
191
  - !ruby/object:Gem::Version
194
192
  version: '0'
195
193
  requirements: []
196
- rubygems_version: 3.1.6
197
- signing_key:
194
+ rubygems_version: 3.6.7
198
195
  specification_version: 4
199
196
  summary: Login amazon.
200
197
  test_files: []