From 7e5b97015c7a25a5a4570efae62b349791aced68 Mon Sep 17 00:00:00 2001 From: MarvNC Date: Sat, 3 Feb 2024 21:58:12 -0800 Subject: [PATCH] Optimize comments --- src/downloadLatest.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/downloadLatest.js b/src/downloadLatest.js index 8105213..fc4aa77 100644 --- a/src/downloadLatest.js +++ b/src/downloadLatest.js @@ -6,7 +6,6 @@ import axios from 'axios'; const domain = 'https://words.hk'; const requestURL = `${domain}/faiman/request_data/`; -const csvURLtxt = 'csv.gz.URLs.txt'; const csvDir = 'csvs'; (async function downloadLatest() { @@ -67,10 +66,6 @@ async function getCSVLinks(dom) { const csvLinks = csvLinkAnchors.map((a) => `${domain}${a.href}`); - // Write to file - // const filePath = path.join(__dirname, csvURLtxt); - // fs.writeFileSync(csvURLtxt, csvLinks.join('\n')); - // console.log(`Wrote csv links to ${csvURLtxt}`); return csvLinks; } @@ -117,6 +112,7 @@ async function downloadCSVs(csvLinks) { .pipe(gzip) .pipe(destination) .on('finish', function () { + // Delete the .gz file fs.unlinkSync(fullPath); }); }