amazon_wish_miner 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 540e25cc6d5661cf2c65b24a2827cfa670caa455c845c1a039cfe94ef44c536f
4
- data.tar.gz: f2f7d46b8eca7e5d088416757f842edf5d6ebc078e374dd8477bf17d5d48a303
3
+ metadata.gz: cae8e40842708aa6ff2d04891d30191c1cbef65c33ce730c1e2ce6bf1e288497
4
+ data.tar.gz: df768c2d0dfff9f890b8a447b56ef84c13c278a27484d4a59a0ff6ed6e663bda
5
5
  SHA512:
6
- metadata.gz: 6c73aaca8ec8b6a58ed3ad6ab808d0e163345beed25d571b7e782197d198bbf22b9a6b126ede29a42a6eae7a5e596b848ca580e1cbfc8c1eaf84cc0a72a2a3dc
7
- data.tar.gz: 24d4a0577dea49247f4fc1569321b5f254d280c12024de29a400acbb7920657fecfc8a161aa52ec3acd023d83dd961c9c8f32e96a5dad4ee6502fdea7b61e7c1
6
+ metadata.gz: 9e472ebd9db4299c882d3ff092fe130fbd6e14ec44b1bb1655fbd7a297273316c90ae385b850f20b86f60c826e0b146c822a306dfabb8792f68f664c36508a1b
7
+ data.tar.gz: c37c3411ab0c2ca39a7e9df1ad215c4016b102c6b931925cbff66e767e3c92f6926b0b559ca4ed4078ccef3afdc3fb1f0586a55c497c267c8d071d1068271d6d
@@ -65,6 +65,15 @@ class AmazonWish
65
65
  AmazonWish.new(asin_arg, title)
66
66
  end
67
67
 
68
+ def self.wishes_from_attributes(attr_hash_array)
69
+ attr_hash_array.map { |attr_hash| item_from_attributes(attr_hash)}
70
+ end
71
+
72
+ def self.item_from_attributes(attr_hash)
73
+ asin = attr_hash[:href].split('/')[2]
74
+ AmazonWish.new(asin, attr_hash[:title])
75
+ end
76
+
68
77
  def self.parse_feature_bullets(feature_bullets_div)
69
78
  bullets = feature_bullets_div.css('ul li')
70
79
  end
@@ -31,6 +31,7 @@ class AmazonWishList
31
31
  #=> appear to be functionally the same. Code should reflect this when it is
32
32
  #=> given links as arguments.
33
33
 
34
+ =begin
34
35
  def self.get_wishlist(amazon_list_id, reveal = :all, sort = :date_added, tld = 'com')
35
36
  raise "invalid reveal" unless REVEAL_OPTIONS.include?(reveal)
36
37
  raise "invalid sort" unless SORT_OPTIONS[sort]
@@ -43,6 +44,12 @@ class AmazonWishList
43
44
  wishes = AmazonWish.parse_wishes_from_pages(pages)
44
45
  AmazonWishList.new(amazon_list_id, wishes)
45
46
  end
47
+ =end
48
+
49
+ def self.get_wishlist(amazon_list_id, reveal = :all, sort = :date_added, tld = 'com')
50
+ wishes = AmazonWish.wishes_from_attributes(wishlist_attributes(amazon_list_id, reveal, sort, tld))
51
+ AmazonWishList.new(amazon_list_id, wishes)
52
+ end
46
53
 
47
54
  def self.get_all_wishlist_pages(url_without_qstring, query_params)
48
55
  responses = Array.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon_wish_miner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander V. Trujillo