urthecast is a simple nodejs client library for the services provided by https://developers.urthecast.com
$ npm i urthecast --save
Note: you will need node
and npm
installed first.
The easiest way to install node.js
is with nave.sh by executing [sudo] ./nave.sh usemain stable
create an instance of the urthecast
client with your api_key
and api_secret
copied from https://developers.urthecast.com/apps
var urthecast = require('urthecast')(MY_KEY, MY_SECRET)
you can execute the urthecast.v1.satellite_tracker()
function with the following arguments:
path
: the uri path eg. "/satellites/iss/orbit_points", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast.v1.satellite_tracker("/satellites/iss/orbit_points", {}, function(err,res){
console.log( err, res.body )
})
you can execute the urthecast.v1.archive()
function with the following arguments:
path
: the uri path eg. "/scenes", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast.v1.archive("/scenes", {}, function(err,res){
console.log( err, res.body )
})
you can execute the urthecast.v1.consumers()
function with the following arguments:
path
: the uri path eg. "/apps/me/aois", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast.v1.consumers("/apps/me/aois", {}, function(err,res){
console.log( err, res.body )
})
you can execute the urthecast.v1.event_streams()
function with the following arguments:
path
: the uri path eg. "/events", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast.v1.event_streams("/events", {}, function(err,res){
console.log( err, res.body )
})
you can execute the urthecast.v1()
function with the following arguments:
path
: the uri path eg. "/satellite_tracker/satellites/iss/orbit_points", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast.v1("/satellite_tracker/satellites/iss/orbit_points", {}, function(err,res){
console.log( err, res.body )
})
you can execute the urthecast()
function directly with the following arguments:
prefix
: this gets prefixed to thepath
, defaults to "/v1"path
: the uri path eg. "/v1/satellite_tracker/satellites/iss/orbit_points", defaults to ""params
: a js object of the query string paramscb
: a callback function which accepts the arguments(err, res)
urthecast("/v1", "/satellite_tracker/satellites/iss/orbit_points", {}, function(err,res){
console.log( err, res.body )
})
The urthecast
npm module can be found here:
https://npmjs.org/package/urthecast
Please fork and pull request against upstream master on a feature branch.