Skip to content

Commit

Permalink
Optimize comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Feb 4, 2024
1 parent 47077d0 commit 7e5b970
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/downloadLatest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -117,6 +112,7 @@ async function downloadCSVs(csvLinks) {
.pipe(gzip)
.pipe(destination)
.on('finish', function () {
// Delete the .gz file
fs.unlinkSync(fullPath);
});
}
Expand Down

0 comments on commit 7e5b970

Please sign in to comment.