amazon_wish_miner 0.3.0 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cae8e40842708aa6ff2d04891d30191c1cbef65c33ce730c1e2ce6bf1e288497
|
4
|
+
data.tar.gz: df768c2d0dfff9f890b8a447b56ef84c13c278a27484d4a59a0ff6ed6e663bda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|