File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3+ /**
4+ * This script gathers current orbital data from the SpaceTrack API,
5+ * and updates the current orbital position for each payload.
6+ */
7+
38const MongoClient = require ( 'mongodb' ) ;
49const request = require ( 'request-promise-native' ) . defaults ( { jar : true } ) ;
510
611const sleep = ms => {
712 return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
813} ;
914
15+ // Using an async foreach so we can use request promises in each payload
1016async function asyncForEach ( array , callback ) {
1117 for ( let index = 0 ; index < array . length ; index += 1 ) {
1218 // Allow await for nested async functions
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3+ /**
4+ * This script gathers tesla roadster orbital data from JPL Horizons,
5+ * parses the output with various regular expressions, and updates
6+ * the data accordingly.
7+ */
8+
39const MongoClient = require ( 'mongodb' ) ;
410const request = require ( 'request-promise-native' ) ;
511const moment = require ( 'moment' ) ;
612const shell = require ( 'shelljs' ) ;
713
814shell . config . silent = true ;
915
16+ // Using date range so Horizons doesn't give us the default 10 day data
1017const today = moment ( ) . format ( 'YYYY-MMM-DD HH:mm:ss' ) ;
1118const tomorrow = moment ( ) . add ( 1 , 'day' ) . format ( 'YYYY-MMM-DD HH:mm:ss' ) ;
1219
You can’t perform that action at this time.
0 commit comments