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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4841ccc74825f1da1c5a55c1218c778e95aa76a
4
- data.tar.gz: 325b346410afcdc343b3fa364a0c49b235ff1958
3
+ metadata.gz: f307250bf968a0ccca940eb6b373e0f5ed8bcac8
4
+ data.tar.gz: 33b385a263ba8f3eeed136f5ada6496306d791b6
5
5
  SHA512:
6
- metadata.gz: 46758b03234360631b666d37ced27e9d59a4a5b684f5e875d97204d1d64f0610d06c0c82259f5424c523a1cef39376839685b1310777eff6bce4a319e155cb45
7
- data.tar.gz: c217c199ad216156c25ce671bc2d720ac9c05f614c7fe53645e94790f7e895a491e603bef16e18c5eb3921f750d1df0764b5e4c944a99ae5fdb2935963632ee9
6
+ metadata.gz: e00da24874c5fd44dc59133b3b824ed39a6a0b2073e25ffd731a04f1815bc680d45fc178524e896c16fff49951e5d443d8ecd8b2295d3a185fc3f75540ccac25
7
+ data.tar.gz: 939384b4f1ab9e2ef973a27f0df1468dcca655500529f437257f8dfeb2927458572525ac9cbd2a249ff6ec9eed803757cb11967ee6cada5b65177e31a3bf4ae2
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.1.2
2
+
3
+ * Also retrieve the highlight annotation_id
4
+
1
5
  # Version 0.1.1
2
6
 
3
7
  * Fix renamed file require
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.get_kindle_highlights # TODO: Pass in something to bide our time
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}"
@@ -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(args)
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
- highlight = (hl/".highlight").text
97
- asin = (hl/".asin").text
98
- Highlight.new(highlight, asin, state[:title], state[:author])
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
@@ -1,3 +1,3 @@
1
1
  module Kindle
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kindle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Petty