GithubHelp home page GithubHelp logo

ferrarinofear / dji Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinelliott/dji

1.0 0.0 0.0 74 KB

CLI and Ruby tools for drone-maker DJI's store, account, and more

License: MIT License

Ruby 99.64% Shell 0.36%

dji's Introduction

DJI

CLI and Ruby tools for drone-maker DJI's store, account, order status and more.

Installation

If you already have Ruby installed on your computer, you can install this. Otherwise, go install Ruby and come back to these instructions.

Open a command line (Terminal on macOS):

$ gem install dji

When updates are released, you can get them with:

$ gem update dji

If you do not manage your Ruby installations with RVM and are just using the system ruby, you might need to prefix the above commands with sudo, such as:

$ sudo gem install dji

If you are on Ubuntu Linux, you can do:

$ sudo apt install ruby ruby-dev
$ sudo gem install dji

Usage

Order Tracking

$ dji track [options]

REQUIRED:

  -o, --order ORDER_NUMBER    # Your order number
  -p, --phone PHONE_TAIL      # Last 4 digits of your phone number

OPTIONAL:
  
  -r, --repeat INTERVAL       # Repeat every INTERVAL seconds
  --publish                   # Publish your order details to http://dji-track.herokuapp.com/orders
  -c, --country COUNTRY       # Your country (use 3 letter code, such as USA)
  -t, --order_time TIMESTAMP  # The timestamp from your private order page at https://accounts.dji.com/user/orders surrounded by quotes (i.e. "2016-09-29 11:21:21 (UTC)")
  -u, --dji_username USERNAME # Your DJI Forum username
  -d, --debug                 # Some additional output used when emailing [email protected] for assistance

Example: Track an order

Use your order number in place of ORDER_NUMBER and the last 4 digits of your phone number for PHONE_TAIL. A full example might look like this:

$ dji track -o 123456789012 -p 1234

ORDER TRACKING AS OF 2016-10-27 01:12:27 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 

Example: Track an order, every 60 seconds

If you want this to repeat automatically at an interval, specify the option for repeat (either -r or --repeat) with the number of seconds. Do not use this nefariously, I suggest a reasonable interval such as 60 seconds, but more useful is probably around 300 seconds (5 minutes) to 600 seconds (10 minutes).

$ dji track -o 123456789012 -p 1234 -r 60

Requesting order tracking details every 60 seconds. Press CONTROL-C to stop...

ORDER TRACKING AS OF 2016-10-27 01:29:36 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 


ORDER TRACKING AS OF 2016-10-27 01:30:37 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 

Example: Track an order, every 5 minutes, and publish details for others to see

$ dji track -o 123456789012 -p 1234 -r 300 --publish -u dronenerd -c USA

ORDER TRACKING AS OF 2016-10-27 01:12:27 -0700
------------------------------------------------------
DJI Forum Username : dronenerd
Order Number       : 123456789012
Total              : USD $1,398.00
Payment Status     : Pay Confirmed

   Country : USA Shipping Status : Pending Shipping Company : Tba Tracking Number :

You have successfully published your latest order status.
See order statuses reported by others at http://dji-track.herokuapp.com/orders

ORDER TRACKING AS OF 2016-10-27 01:17:28 -0700
------------------------------------------------------
DJI Forum Username : dronenerd
Order Number       : 123456789012
Total              : USD $1,398.00
Payment Status     : Pay Confirmed

   Country : USA Shipping Status : Pending Shipping Company : Tba Tracking Number :

You have successfully published your latest order status.
See order statuses reported by others at http://dji-track.herokuapp.com/orders

Search FedEx and track by reference

If you think your shipper is FedEx but you don't have a tracking code yet, you might be able to find your shipment by searching Fedex by reference. This allows you to search and track by reference.

$ dji track -c COUNTRY_CODE -p POSTAL_CODE

An example of searching in the USA (country code is us) with a postal code:

$ dji fedex -c us -p 94123

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:44:37 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

If you want to search by a different reference, you can optionally pass it in:

$ dji fedex -c us -p 94123 --reference DJIGOODS

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:50:57 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

You may also have it repeat the search on a regular interval (in seconds):

$ dji fedex -c us -p 94123 -r 120

Requesting FedEx tracking by reference DJIGOODS every 120 seconds. Press CONTROL-C to stop...

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:53:41 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created


FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:55:42 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dji. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

dji's People

Contributors

kevinelliott avatar danm72 avatar daveio avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.