Readme

Helper function to get Advent of Code data

AOC_TOKEN is a session token

1
2
3
4
5
6
7
8
9
import { fetch } from "https://esm.town/v/std/fetch?v=4";
export default async (day: number, year: number = 2023) => {
return await fetch(`https://adventofcode.com/${year}/day/${day}/input`, {
headers: {
"Cookie": Deno.env.get("AOC_TOKEN"),
},
});
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
December 4, 2023