@ictrobot/aoc-leaderboard
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

aoc-leaderboard

Advent of Code private leaderboard API fetcher with TS types, and a CLI to display all the information from the API.

CLI Usage

AOC_SESSION=YOUR_COOKIE_HERE npx @ictrobot/aoc-leaderboard <leaderboard_id> [year]

(year defaults to this year in december, and the previous year otherwise)

  • AOC_SESSION is required to access the API, and should be set to the value of your session cookie on adventofcode.com
  • leaderboard_id and year come from the URL of the private leaderboard, i.e. https://adventofcode.com/YEAR/leaderboard/private/view/LEADERBOARD_ID

TS Usage

import {fetchLeaderboard} from "@ictrobot/aoc-leaderboard";

const sessionCookie = "A LONG HEX STRING";
const year = "2021";
const leaderboardID = "12345";

const leaderboard = await fetchLeaderboard(sessionCookie, year, leaderboardID)

License

MIT License.

Package Sidebar

Install

npm i @ictrobot/aoc-leaderboard

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

23.8 kB

Total Files

9

Last publish

Collaborators

  • ictrobot