Fetch fcc.org user curriculum progress

PHOTO EMBED

Tue Apr 27 2021 22:51:13 GMT+0000 (Coordinated Universal Time)

Saved by @jamie #nodejs

const fetch = require('isomorphic-fetch')


const query = fetch('https://www.freecodecamp.org/page-data/sq/d/4195245674.json')
    .then(resp => resp.json())
    .then(data => {
        // console.log(data)
        return data.data.allChallengeNode.edges.map(e => {
            // console.log(e.node)
            const url_pieces = e.node.fields.slug.split('/')
            return { 
                name: e.node.title, 
                cert: url_pieces[2], 
                section: url_pieces[3], 
                task: url_pieces[4] 
            }
        })
    }).then(q => console.log(q))
content_copyCOPY

wrote it myself