From 8cbeba56d433510c03778ec6ebdb4208c3e35c02 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 28 Nov 2023 21:19:23 -0300 Subject: [PATCH] =?UTF-8?q?guardar=20basado=20en=20ubicaci=C3=B3n=20de=20d?= =?UTF-8?q?ata.json=20y=20no=20solo=20dominio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- download_json.js | 2 +- readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/download_json.js b/download_json.js index e79056a..91cb943 100644 --- a/download_json.js +++ b/download_json.js @@ -65,7 +65,7 @@ for (const url of jsonUrls) */ async function downloadFromData(jsonUrlString) { const jsonUrl = new URL(jsonUrlString); - const outputPath = jsonUrl.host; + const outputPath = `${jsonUrl.host}${jsonUrl.pathname}`.replaceAll("/", "_"); await mkdir(outputPath, { recursive: true }); const errorFile = ( await open(join(outputPath, "errors.jsonl"), "w") diff --git a/readme.md b/readme.md index bfbfae7..ae358ae 100644 --- a/readme.md +++ b/readme.md @@ -27,7 +27,7 @@ docker run --rm -it -v ./data:/data gitea.nulo.in/nulo/transicion-desordenada-di ## formato de repo guardado -- `{dominio de repo}/` +- `{url de data.json sin protocolo y con / reemplazado por _}/` - `data.json` - `errors.jsonl`: archivo con todos los errores que se obtuvieron al intentar descargar todo. - `{identifier de dataset}/` @@ -36,7 +36,7 @@ docker run --rm -it -v ./data:/data gitea.nulo.in/nulo/transicion-desordenada-di ### ejemplo -- `datos.gob.ar/` +- `datos.gob.ar_data.json/` - `data.json` - `errors.jsonl` - `turismo_fbc269ea-5f71-45b6-b70c-8eb38a03b8db/`