mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2024-12-22 08:06:25 +00:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
|
const { default: axios } = require('axios')
|
||
|
|
||
|
async function getInput(year, day) {
|
||
|
const { data } = await axios({
|
||
|
url: `https://adventofcode.com/${year}/day/${day}/input`,
|
||
|
headers: {
|
||
|
Cookie: `session=${process.env.TOKEN};`,
|
||
|
},
|
||
|
})
|
||
|
return data
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
params: async ({ args }) => {
|
||
|
return { ...args, input: await getInput(args.year, args.day) }
|
||
|
},
|
||
|
}
|