kindle-highlights 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kindle_highlights/client.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca078732a0f8c044fd58e477e04cca81e3c7ce4
|
4
|
+
data.tar.gz: 4b3f307f66e416299a2b9a7bcea222e23c2ca1aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 374c237750768c482a465071098bd9dec30d894cfd242013fb94e3fc02d105bac4fdbaf410e0b95aa02093e312e1a2af2fe7a23569968f08c19b8acf332b07cb
|
7
|
+
data.tar.gz: bcf457268d3992b8984c9acdbe555bafb0ce9057d5093cf0d7db0e99d7ebf8d52b745efa59768327d0bbb1a469b986855fcc904abac99a4568d1d751ceae1fdb
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module KindleHighlights
|
2
2
|
class Client
|
3
3
|
class CaptchaError < StandardError; end
|
4
|
+
class AuthenticationError < StandardError; end
|
4
5
|
|
5
6
|
attr_writer :mechanize_agent
|
6
7
|
attr_accessor :kindle_logged_in_page
|
@@ -49,6 +50,9 @@ module KindleHighlights
|
|
49
50
|
if post_signin_page.search("#ap_captcha_img").any?
|
50
51
|
resolution_url = post_signin_page.link_with(text: /See a new challenge/).resolved_uri.to_s
|
51
52
|
raise CaptchaError, "Received a CAPTCHA while attempting to sign in to your Amazon account. You will need to resolve this manually at #{resolution_url}"
|
53
|
+
elsif post_signin_page.search("#message_error > p").any?
|
54
|
+
amazon_error = post_signin_page.search("#message_error > p").children.first.to_s.strip
|
55
|
+
raise AuthenticationError, "Unable to sign in, received error: '#{amazon_error}'"
|
52
56
|
else
|
53
57
|
@kindle_logged_in_page = post_signin_page
|
54
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kindle-highlights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Farkas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|