Liking cljdoc? Tell your friends :D

Advent of code data | aocd

Get your advent of code input every day with a simple function call.

  • download new advent of code input
  • load advent of code input into your code as a String
  • cache input so that you only need to download input once

Clojure version of the scala library by the same name that is in turn based on a python library.

Usage

Quick start

(require '[aocd.core :as data])
(data/input 2019 4) => "124075-580769\n"

Installation

aocd is available as a Maven artifact from Clojars.

Leiningen/Boot:

[aocd "0.1.1"]

Setup

Advent of code inputs are personal hence a session token is needed in order to fetch your input. aocd supports providing this token in two ways:

# env variable
$ export AOC_SESSION_TOKEN="yoursessionstoken"
# or config file
$ echo "yoursessiontoken" > $HOME/.config/aocd/token

Cache

The downloaded input files are stored in

$HOME/.config/aocd/{year}/{day}/input.txt

How to get session token

  1. Log in to advent of code.
  2. Open any input link from
  3. Open developer mode

Session cookie from browser

Above was taken from here

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close