Skip to content

Commit 03a74c7

Browse files
committed
update script comment updates
1 parent c2d1153 commit 03a74c7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

scripts/orbits.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
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+
38
const MongoClient = require('mongodb');
49
const request = require('request-promise-native').defaults({ jar: true });
510

611
const 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
1016
async function asyncForEach(array, callback) {
1117
for (let index = 0; index < array.length; index += 1) {
1218
// Allow await for nested async functions

scripts/roadster.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
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+
39
const MongoClient = require('mongodb');
410
const request = require('request-promise-native');
511
const moment = require('moment');
612
const shell = require('shelljs');
713

814
shell.config.silent = true;
915

16+
// Using date range so Horizons doesn't give us the default 10 day data
1017
const today = moment().format('YYYY-MMM-DD HH:mm:ss');
1118
const tomorrow = moment().add(1, 'day').format('YYYY-MMM-DD HH:mm:ss');
1219

0 commit comments

Comments
 (0)