rom1dep/advent-of-code-data

Download Advent of Code input data with ease.

★ 0Forks 0GitHub ↗Compare

README

Advent of Code Data

Important Badge Version

Scala version of the python library by the same name.

Requires Mill 0.9.3.

Usage

I haven't publish on maven yet, so it will need to be published locally:

git clone https://github.com/bbstilson/advent-of-code-data.git
cd advent-of-code-data
mill aocd.publishLocal

It's ready to use!

Add it to your library deps:

ivy"io.github.bbstilson::aocd:0.1.0" // mill
"io.github.bbstilson" %% "aocd" % "0.1.0" // sbt

Export your session token, which can be found in your browser cookies after authenticating on the Advent of Code site.

export AOC_SESSION_TOKEN="whateveritis"

Now go solve the problem!

import aocd.Problem

object Day1 extends Problem(2020, 1) {
  def run(input: List[String]): Unit = {
    // you can do it!
  }
}

Behind the Scenes

Your data is downloaded to ~/.aocd/<YYYY>/<DD>/input.txt. The download is only done once, subsequent runs will just read the data from that directory.

Contributors

bbstilson

Issues