dji 0.5.0 → 0.5.1
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 +21 -16
- data/lib/dji/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82fd8c61b70c5a7b5980b388726aae3b8ac92dc
|
4
|
+
data.tar.gz: 40a0a18edb195b887ee85bf3d4abbdd913c28380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaad2ed22058032b63f701dafcde2255e220ce4d61e3a74c4fc46bb5f89f1605f1c058884cf6c08fbb5b815b2ef2381d5cb7cdb3576c8ebfbfa8b7ea02300d84
|
7
|
+
data.tar.gz: 5e524a3f7028e8b004ee127b3b623406f1f8858e3e0dddb6a2ddfc6a554a48437223c7ceff50ffa14256d05804ab7ccb96ff812628ea20e497fe2a13266eb86b
|
data/lib/dji/order_tracking.rb
CHANGED
@@ -64,22 +64,27 @@ module DJI
|
|
64
64
|
page = Nokogiri::HTML(response.body)
|
65
65
|
content = page.at_xpath('//div[@id="main"]/div[@class="container"]/div[@class="row"]/div[@class="col-xs-9"]/div[@class="col-xs-10 well"][2]')
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
67
|
+
if content.text.blank? || content.text.include?('Sorry, record not found.')
|
68
|
+
puts "Order #{options[:order_number]}/#{options[:phone_tail]} not found!"
|
69
|
+
else
|
70
|
+
data = {}
|
71
|
+
data[:order_number] = content.at_xpath('div[1]').text.split(' ')[-1]
|
72
|
+
data[:total] = content.at_xpath('div[2]').text.split(' ')[1..-1].join(' ')
|
73
|
+
data[:payment_status] = content.at_xpath('div[3]').text.split(': ')[1]
|
74
|
+
data[:shipping_status] = content.at_xpath('div[4]').text.split(': ')[1]
|
75
|
+
data[:shipping_company] = content.at_xpath('div[5]/span').text
|
76
|
+
data[:tracking_number] = content.at_xpath('div[6]/a').text
|
77
|
+
|
78
|
+
data[:debug] = options[:debug] if options[:debug].present?
|
79
|
+
data[:dji_username] = options[:dji_username] if options[:dji_username].present?
|
80
|
+
data[:email_address] = options[:email_address] if options[:email_address].present?
|
81
|
+
data[:phone_tail] = options[:phone_tail] if options[:phone_tail].present?
|
82
|
+
data[:order_time] = options[:order_time] if options[:order_time].present?
|
83
|
+
data[:shipping_country] = options[:country] if options[:country].present?
|
84
|
+
|
85
|
+
print_tracking_details(data)
|
86
|
+
end
|
87
|
+
|
83
88
|
data
|
84
89
|
else
|
85
90
|
puts "There was an error: #{response.message}"
|
data/lib/dji/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|