amazon_order 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/lib/amazon_order/parsers/order.rb +13 -3
- data/lib/amazon_order/parsers/product.rb +1 -1
- data/lib/amazon_order/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e865042b91b22077149316ff57d575168bc43635
|
|
4
|
+
data.tar.gz: ca3967e1120cbcee525fa691d22cd7c9744bba51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99679b709cfe850447a320f941550f0e7d88c23b16b9d44fd43d6df7984f6c76d80275f2278906c24a38fd8fdaf173ddbfaf9ecdbcabf58c4131cf573b00faaa
|
|
7
|
+
data.tar.gz: 145c6fb0c6eb615b8d92e5c00f686cd7a8f6e869f209c821431504e6e9728edacbdbfe7d8fcfabed0163e379077717561884d804ff101268be208afb5fcfa41c
|
|
@@ -17,7 +17,7 @@ module AmazonOrder
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def order_total
|
|
20
|
-
@_order_total ||= @node.css('.order-info .a-col-left .a-column')[1].css('.value').text.strip.gsub(/[^\d\.]/,'').to_f
|
|
20
|
+
@_order_total ||= @node.css('.order-info .a-col-left .a-column')[1].css('.value').text.strip.gsub(/[^\d\.]/, '').to_f
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def shipment_status
|
|
@@ -26,9 +26,15 @@ module AmazonOrder
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def shipment_note
|
|
29
|
-
@_shipment_note ||=
|
|
29
|
+
@_shipment_note ||= case order_type
|
|
30
|
+
when :item_order
|
|
31
|
+
@node.css('.shipment .shipment-top-row').present? ? @node.css('.shipment .shipment-top-row .a-row')[1].text.strip : nil
|
|
32
|
+
when :service_order
|
|
33
|
+
nil
|
|
34
|
+
end
|
|
30
35
|
end
|
|
31
36
|
|
|
37
|
+
|
|
32
38
|
def order_details_path
|
|
33
39
|
@_order_details_path ||= @node.css('.order-info .a-col-right .a-row')[1].css('a.a-link-normal')[0].attr('href')
|
|
34
40
|
end
|
|
@@ -38,7 +44,7 @@ module AmazonOrder
|
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
def products
|
|
41
|
-
@_products ||= @node.css('.a-box.order-info ~ .a-box .a-col-left .a-row')[0].css('.a-fixed-left-grid').map{|e| AmazonOrder::Parsers::Product.new(e, fetched_at: fetched_at) }
|
|
47
|
+
@_products ||= @node.css('.a-box.order-info ~ .a-box .a-col-left .a-row')[0].css('.a-fixed-left-grid').map { |e| AmazonOrder::Parsers::Product.new(e, fetched_at: fetched_at) }
|
|
42
48
|
end
|
|
43
49
|
|
|
44
50
|
|
|
@@ -47,6 +53,10 @@ module AmazonOrder
|
|
|
47
53
|
hash.merge!(products: products.map(&:to_hash))
|
|
48
54
|
end
|
|
49
55
|
end
|
|
56
|
+
|
|
57
|
+
def order_type
|
|
58
|
+
@node.css('[id^=Leave-Service-Feedback]').present? ? :service_order : :item_order
|
|
59
|
+
end
|
|
50
60
|
end
|
|
51
61
|
end
|
|
52
62
|
end
|
data/lib/amazon_order/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: amazon_order
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuho Yamaguchi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: amazon_auth
|
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
version: '0'
|
|
154
154
|
requirements: []
|
|
155
155
|
rubyforge_project:
|
|
156
|
-
rubygems_version: 2.6.
|
|
156
|
+
rubygems_version: 2.6.13
|
|
157
157
|
signing_key:
|
|
158
158
|
specification_version: 4
|
|
159
159
|
summary: Scrape information of amazon orders
|