kindle 0.1.1 → 0.1.2
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 +4 -4
- data/Changelog +4 -0
- data/bin/kindle +1 -1
- data/lib/kindle/highlight.rb +3 -3
- data/lib/kindle/highlights_parser.rb +5 -4
- data/lib/kindle/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f307250bf968a0ccca940eb6b373e0f5ed8bcac8
|
4
|
+
data.tar.gz: 33b385a263ba8f3eeed136f5ada6496306d791b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00da24874c5fd44dc59133b3b824ed39a6a0b2073e25ffd731a04f1815bc680d45fc178524e896c16fff49951e5d443d8ecd8b2295d3a185fc3f75540ccac25
|
7
|
+
data.tar.gz: 939384b4f1ab9e2ef973a27f0df1468dcca655500529f437257f8dfeb2927458572525ac9cbd2a249ff6ec9eed803757cb11967ee6cada5b65177e31a3bf4ae2
|
data/Changelog
CHANGED
data/bin/kindle
CHANGED
@@ -9,7 +9,7 @@ passwd = ask("Enter your Amazon.com password (This is not stored): ") { |q| q.e
|
|
9
9
|
begin
|
10
10
|
k = Kindle::Highlights.new(:login => login, :password => passwd)
|
11
11
|
puts "Getting your kindle highlights..."
|
12
|
-
highlights = k.
|
12
|
+
highlights = k.fetch_kindle_highlights # TODO: Pass in something to bide our time
|
13
13
|
# TODO: Multiple output formats. CSV, JSON, Pretty, HTML?
|
14
14
|
highlights.each do |highlight|
|
15
15
|
puts "#{highlight.asin};#{highlight.title};#{highlight.author};#{highlight.highlight}"
|
data/lib/kindle/highlight.rb
CHANGED
@@ -2,10 +2,10 @@ module Kindle
|
|
2
2
|
|
3
3
|
class Highlight
|
4
4
|
|
5
|
-
attr_reader :highlight, :asin, :title, :author
|
5
|
+
attr_reader :id, :highlight, :asin, :title, :author
|
6
6
|
|
7
|
-
def initialize(highlight, asin, title, author)
|
8
|
-
@highlight, @asin, @title, @author = highlight, asin, title, author
|
7
|
+
def initialize(id, highlight, asin, title, author)
|
8
|
+
@id, @highlight, @asin, @title, @author = id, highlight, asin, title, author
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
@@ -10,7 +10,7 @@ module Kindle
|
|
10
10
|
options.each_pair { |k,v| instance_variable_set("@#{k}", v) }
|
11
11
|
end
|
12
12
|
|
13
|
-
def get_highlights
|
13
|
+
def get_highlights
|
14
14
|
state = {
|
15
15
|
current_offset: 25,
|
16
16
|
current_upcoming: []
|
@@ -93,9 +93,10 @@ module Kindle
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def parse_highlight(hl, state)
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
highlight_id = hl.xpath('//*[@id="annotation_id"]').first["value"]
|
97
|
+
highlight = (hl/".highlight").text
|
98
|
+
asin = (hl/".asin").text
|
99
|
+
Highlight.new(highlight_id, highlight, asin, state[:title], state[:author])
|
99
100
|
end
|
100
101
|
|
101
102
|
end
|
data/lib/kindle/version.rb
CHANGED