dji 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dji/order_tracking.rb +4 -3
- data/lib/dji/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: 7aba532042ed1552502a65c50788e3ab99d2e01b
|
4
|
+
data.tar.gz: 327f92e33e0734032822b97f682578a7e29917f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d873d8562bdb90a5126838033014cf31f53fac958e9878c3af0fbcbd2d4e2896ab6d7b5b05828c2aa9979c0bea1b0d97fbe2b440597b03986e04b44b1d5ab130
|
7
|
+
data.tar.gz: 52bf5decfba89a07cce0a1fc0141c4dcfe1e837936daf688a37d2bbb700c50909926a5c004e75320b4e4ed68a87bd0f879dc4c5c93e507d1e47e5170bcc92271
|
data/lib/dji/order_tracking.rb
CHANGED
@@ -69,6 +69,7 @@ module DJI
|
|
69
69
|
page = Nokogiri::HTML(response.body)
|
70
70
|
|
71
71
|
content = page.at_xpath('//div[@id="custom-info"]/div[@class="order-tracking"]')
|
72
|
+
puts content.to_html if options[:debug]
|
72
73
|
|
73
74
|
if content.text.blank? || content.text.include?('Sorry, record not found.')
|
74
75
|
puts "Order #{options[:order_number]}/#{options[:phone_tail]} not found!" if options[:output]
|
@@ -78,10 +79,10 @@ module DJI
|
|
78
79
|
data[:total] = content.at_xpath('p[2]').text.split(' ')[1..-1].join(' ')
|
79
80
|
data[:payment_status] = content.at_xpath('p[3]').text.split(': ')[1]
|
80
81
|
data[:shipping_status] = content.at_xpath('p[4]').text.split(': ')[1]
|
81
|
-
data[:shipping_company] = if content.at_xpath('p[5]
|
82
|
-
content.at_xpath('p[5]
|
82
|
+
data[:shipping_company] = if content.at_xpath('p[5]').present?
|
83
|
+
content.at_xpath('p[5]').text.split(': ')[1].downcase
|
83
84
|
else
|
84
|
-
'
|
85
|
+
'tba'
|
85
86
|
end
|
86
87
|
data[:tracking_number] = if content.at_xpath('p[6]/a').present?
|
87
88
|
content.at_xpath('p[6]/a').text
|
data/lib/dji/version.rb
CHANGED