solution.js
unknown
javascript
5 years ago
444 B
5
Indexable
const fs = require('fs');
const {
getResults,
getResultDetails
} = require('./scraper.js');
(async () => {
let solution = {
articles: []
};
let links = await getResults()
for (const link of links) {
const results = await getResultDetails(link);
solution.articles.push(results);
}
let jsonString = JSON.stringify(solution);
fs.writeFileSync('solution.json', jsonString, 'utf-8');
})()Editor is loading...