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.
(require '[aocd.core :as data])
(data/input 2019 4) => "124075-580769\n"
aocd is available as a Maven artifact from Clojars.
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
The downloaded input files are stored in
- Log in to advent of code.
- Open any
input link from
- Open developer mode
Above was taken from here