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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c3aa0a694ddd6019718a22f20d31c8e6d099c02
4
- data.tar.gz: 7304a4eb8f76bc2a07c74e4c4da763603c815171
3
+ metadata.gz: 709b42b533db5c7dd69ba5875661fa008d06f8f0
4
+ data.tar.gz: ba9c86ae0d78b2d9e1208296a141fd22e0879bdb
5
5
  SHA512:
6
- metadata.gz: 07e0ba9e4fea478c3e0b8d618a548c907bfb82b5c23cf98145cc489f262d94bd57c997bd41d8fd910ff1d6d49d00bf920c78343ae7ce648ee3258434dac49948
7
- data.tar.gz: 22512f43a8d4aa3e31e4f9ff32edc1a966979533e9f043888afb2f530d21e30dfaf621901a637c589c17e06ddff963d59921d2f4bdfe1ded92c53ed950eb2345
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 :
@@ -8,7 +8,7 @@ module DJI
8
8
  option :publish, required: false, default: false
9
9
  option :country, required: false, aliases: :c
10
10
  option :dji_username, required: false, aliases: [:username, :u]
11
-
11
+
12
12
  def track
13
13
  provided_options = {
14
14
  order_number: options[:order_number],
@@ -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 = Nokogiri::HTML(response.body)
20
- token = page.at_xpath('//meta[@name="csrf-token"]/@content').text
21
- cookie = response['set-cookie']
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
@@ -1,3 +1,3 @@
1
1
  module DJI
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Elliott