solution.js

Anonymous
javascript
10/09/2020 5:27 AM
592 B
13
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...