import fs from 'fs'
export function parseBoardList(boardList) {
    // console.log(JSON.stringify(boardList))
    try {
        boardList.data.children
    } catch (e) {
        log.error(`Bad reddit data returned => ${e}`)
    }

    const boards = boardList.data.children.map(board => board.data) // thanks, reddit!

    return boards.map(({url, title}) => {
        let boardID = url.split('/').slice(-2)[0]
        console.log(boardID)
        return {
            boardID,
            description: `${url} - ${title}`
        }
    });
}
import fs from 'fs'
export function parseBoardList(boardList) {
    // console.log(JSON.stringify(boardList))
    try {
        boardList.data.children
    } catch (e) {
        log.error(`Bad reddit data returned => ${e}`)
    }

    const boards = boardList.data.children.map(board => board.data) // thanks, reddit!

    return boards.map(({url, title}) => {
        let boardID = url.split('/').slice(-2)[0]
        return {
            boardID,
            description: `/${boardID}/ - ${title}`
        }
    });
}
Remove '/r/' from reddit board list
Remove '/r/' from reddit board list
