Skip to content

Commit

Permalink
remove Iridium NEXT fixes for upcoming launch script
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Jan 12, 2019
1 parent bf8a1cc commit 43f3057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><img src="https://farm5.staticflickr.com/4840/45473446114_7d5e5d6fe2_o.jpg"></p>
<p align="center"><img src="https://farm5.staticflickr.com/4891/39745614053_43855205bc_o.jpg"></p>

<h1 align="center">SpaceX REST API</h1>

Expand Down
18 changes: 2 additions & 16 deletions scripts/upcoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,7 @@ const month_vague = /^[0-9]{4}\s(early|mid|late)\s([a-z]{3}|[a-z]{3,9})$/i;

// Collect site names for time zone and payload name for fuzzy check
launches.forEach(launch => {
// Add temp fix for last Iridium NEXT launch because we need fuzzy
// search to return 100% substring match, else we get SSO-A and SSO-B changing
// because of a slight difference.
// NOTE: Will be removed after launch
if (launch.rocket.second_stage.payloads[0].payload_id === 'Iridium NEXT 8') {
payloads.push('Iridium 8');
} else {
payloads.push(launch.rocket.second_stage.payloads[0].payload_id);
}
payloads.push(launch.rocket.second_stage.payloads[0].payload_id);
sites.push(launch.launch_site.site_id);
});

Expand All @@ -84,7 +76,7 @@ const month_vague = /^[0-9]{4}\s(early|mid|late)\s([a-z]{3}|[a-z]{3,9})$/i;
const manifest = $('body > div.content > div > div > table:nth-child(6) > tbody').text();
const manifest_row = manifest.split('\n').filter(v => v !== '');

// Filter to collect manaifest dates
// Filter to collect manifest dates
const manifest_dates = manifest_row.filter((value, index) => index % 8 === 0);

// Filter to collect payload names
Expand Down Expand Up @@ -233,12 +225,6 @@ const month_vague = /^[0-9]{4}\s(early|mid|late)\s([a-z]{3}|[a-z]{3,9})$/i;
console.log(calculatedTimes);
console.log('');

// Another special case added for last Iridium launch
// NOTE: Will be removed after launch
if (payload === 'Iridium 8') {
payload = 'Iridium NEXT 8';
}

// Add to array of promises to update all at once after the forEach iterations finish
promises.push(col.updateOne({ 'rocket.second_stage.payloads.payload_id': payload }, { $set: calculatedTimes }));
}
Expand Down

0 comments on commit 43f3057

Please sign in to comment.