-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from NASA-IMPACT/feat/kmz-inside-zip
- Loading branch information
Showing
12 changed files
with
418 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
deployments: | ||
- name: PODEX-D1_2013 | ||
platforms: | ||
- name: ER-2 | ||
files: | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA/2013-01-14/IWG1.xml | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-14/IWG1.15Jan2013-0002 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-16/IWG1.16Jan2013-2108 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-18/IWG1.18Jan2013-2203 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-20/IWG1.20Jan2013-2149 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-22/IWG1.23Jan2013-0030 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-28/IWG1.28Jan2013-2322 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-01-31/IWG1.31Jan2013-2257 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-02-01/IWG1.01Feb2013-2317 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-02-03/IWG1.03Feb2013-1452 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-02-03/IWG1.03Feb2013-2312 | ||
- https://asp-archive.arc.nasa.gov/PODEX/N809NA//2013-02-06/IWG1.07Feb2013-0001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
deployments: | ||
- name: Polar Winds-D1_2014 | ||
platforms: | ||
- name: B-200 | ||
filter_kmz: true | ||
files: | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141029-115154_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141030-132302_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141031-110108_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141103-135618_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141104-135816_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141105-141140_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141106-140534_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141107-141738_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141108-155441_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141110-142837_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141111-140700_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141112-110621_txt.zip | ||
- https://asdc.larc.nasa.gov/data/PolarWindsI/DAWN_KingAirUC-12B_1/PolarWindsI_DAWN_KingAirUC-12B_1.20141113-140215_txt.zip | ||
- name: Polar Winds-D2_2015 | ||
platforms: | ||
- name: DC-8 | ||
files: | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2014-10-25/IWG1.xml | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-07/IWG1.07May2015-2226 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-09/IWG1.09May2015-1401 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-11/IWG1.11May2015-1728 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-13/IWG1.13May2015-1509 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-15/IWG1.15May2015-2032 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-16/IWG1.16May2015-2115 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-17/IWG1.17May2015-2117 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-19/IWG1.19May2015-1708 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-21/IWG1.21May2015-2202 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-23/IWG1.23May2015-2001 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-24/IWG1.24May2015-1835 | ||
- https://asp-archive.arc.nasa.gov/N817NA/FY2015/2015-05-25/IWG1.25May2015-1729 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { listLinks } = require('./src/list-links'); | ||
|
||
const url = process.argv[2]; | ||
const outputFile = process.argv[3]; | ||
|
||
// this is a utility command to list the files URLs in some NASA websites, | ||
// like https://asp-archive.arc.nasa.gov/PODEX/N809NA/ | ||
// It will create a txt with the URLs of the files listed in the | ||
// subpages of that webpage. | ||
// It also filters out all the files that don't contain the string "IWG1." | ||
// and the .xml files | ||
|
||
// Usage: | ||
// yarn list-files https://asp-archive.arc.nasa.gov/PODEX/N809NA/ podex.txt | ||
|
||
listLinks(url, outputFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const fs = require('fs'); | ||
const axios = require('axios'); | ||
const cheerio = require('cheerio'); | ||
|
||
async function getLinks(url) { | ||
/** | ||
* Retrieves all the links from a given webpage. | ||
* @param {string} url - The URL of the webpage to be accessed. | ||
* @returns {string[]} - A list of all the links found on the webpage. | ||
*/ | ||
const response = await axios.get(url); | ||
const $ = cheerio.load(response.data); | ||
const links = $('a').map((_, link) => `${url}/${$(link).attr('href')}`).get(); | ||
return links; | ||
} | ||
|
||
function saveToCSV(links, outputFileName) { | ||
/** | ||
* Saves a list of links to a CSV file. | ||
* @param {string[]} links - A list of links to be saved. | ||
* @param {string} outputFileName - The name of the output CSV file. | ||
*/ | ||
fs.writeFileSync(outputFileName, links.join('\n')); | ||
} | ||
|
||
async function listLinks(url, outputFileName) { | ||
const initialLinks = await getLinks(url); | ||
const allLinks = await Promise.all(initialLinks.map((i) => getLinks(i))); | ||
saveToCSV( | ||
allLinks | ||
.flat().filter((i) => i.includes('IWG1.') && !i.includes('.xml')), | ||
outputFileName | ||
); | ||
} | ||
|
||
module.exports = { | ||
listLinks, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.