dji 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/dji/commands/track/track_command.rb +1 -1
- 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: 709b42b533db5c7dd69ba5875661fa008d06f8f0
|
4
|
+
data.tar.gz: ba9c86ae0d78b2d9e1208296a141fd22e0879bdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9deae5ba1a44390df1625e75313b662572ed85f59d03a26fe7d0f8c9969f3aaac9cc759d7e2c008c281429924c7cf560c2e312001f54b76ee276a9779b6007de
|
7
|
+
data.tar.gz: b692e03ab6e77e5a565761604e7f2ae2629d8f295d088b48889e02c6865a5ce7af1364ce8d447956dcc75b2cc09fb5e7b7d36d26aa61b2e696ccbe8e4e21b574
|
data/README.md
CHANGED
@@ -36,6 +36,7 @@ OPTIONS:
|
|
36
36
|
-p, --phone PHONE_TAIL # Last 4 digits of your phone number
|
37
37
|
-r, --repeat INTERVAL # Optional: Repat every INTERVAL seconds
|
38
38
|
--publish # Optional: Publish your order details to http://dji-track.herokuapp.com/orders
|
39
|
+
-c, --country COUNTRY # Optional: Your country (use 3 letter code, such as USA)
|
39
40
|
-u, --dji_username USERNAME # Optional: Your DJI Forum username
|
40
41
|
```
|
41
42
|
|
@@ -83,7 +84,7 @@ If you want this to repeat automatically at an interval, specify the option for
|
|
83
84
|
|
84
85
|
#### Example: Track an order, every 5 minutes, and publish details for others to see
|
85
86
|
|
86
|
-
$ dji track -o 123456789012 -p 1234 -r 300 --publish -u dronenerd
|
87
|
+
$ dji track -o 123456789012 -p 1234 -r 300 --publish -u dronenerd -c USA
|
87
88
|
|
88
89
|
ORDER TRACKING AS OF 2016-10-27 01:12:27 -0700
|
89
90
|
------------------------------------------------------
|
@@ -91,6 +92,7 @@ If you want this to repeat automatically at an interval, specify the option for
|
|
91
92
|
Order Number : 123456789012
|
92
93
|
Total : USD $1,398.00
|
93
94
|
Payment Status : Pay Confirmed
|
95
|
+
Country : USA
|
94
96
|
Shipping Status : Pending
|
95
97
|
Shipping Company : Tba
|
96
98
|
Tracking Number :
|
@@ -104,6 +106,7 @@ If you want this to repeat automatically at an interval, specify the option for
|
|
104
106
|
Order Number : 123456789012
|
105
107
|
Total : USD $1,398.00
|
106
108
|
Payment Status : Pay Confirmed
|
109
|
+
Country : USA
|
107
110
|
Shipping Status : Pending
|
108
111
|
Shipping Company : Tba
|
109
112
|
Tracking Number :
|
data/lib/dji/order_tracking.rb
CHANGED
@@ -16,9 +16,10 @@ module DJI
|
|
16
16
|
request = Net::HTTP::Get.new uri.path
|
17
17
|
response = http.request request
|
18
18
|
|
19
|
-
page
|
20
|
-
|
21
|
-
|
19
|
+
page = Nokogiri::HTML(response.body)
|
20
|
+
token_dom = page.at_xpath('//meta[@name="csrf-token"]/@content')
|
21
|
+
token = token_dom.text if token_dom.present?
|
22
|
+
cookie = response['set-cookie']
|
22
23
|
|
23
24
|
{ param: 'authenticity_token', token: token, cookie: cookie }
|
24
25
|
end
|
data/lib/dji/version.rb
CHANGED