BSD-3-Clause licensed by Justin Le
Maintained by [email protected]
This version can be pinned in stack with:advent-of-code-api-0.1.2.3@sha256:0366c0d49aba60917b69b95779bf03de37ab54be2d81cf9804aabe60ceeec7df,2162

Module documentation for 0.1.2.3

advent-of-code-api

advent-of-code-api on Hackage Build Status

Haskell bindings for Advent of Code REST API. Caches and throttles requests automatically.

Specify your requests with AoC and AoCOpts, and run them with runAoC.

Examples:

-- Fetch prompts for day 5
runAoC myOpts $ AoCPrompt (mkDay_ 5)

-- Fetch input for day 8
runAoC myOpts $ AoCInput (mkDay_ 8)

-- Submit answer "hello" for Day 10, Part 1
runAoC myOpts $ AoCSubmit (mkDay_ 10) Part1 "hello"

Please use responsibly. All actions are rate-limited to a default of one request every three seconds, with ability to adjust up to as fast as a hard-coded limit of one request per second.

Note that leaderboard API is not yet supported.

Requires libcurl, with future plans to move to a “pure Haskell” networking backend.

Session Keys

Session keys are required for all commands, but if you enter a bogus key you should be able to get at least Part 1 from AoCPrompt.

The session key can be found by logging in on a web client and checking the cookies. You can usually check these with in-browser developer tools.

Changes

Changelog

Version 0.1.2.X

Version 0.1.2.0

December 7, 2018

https://github.com/mstksg/advent-of-code-api/releases/tag/v0.1.2.0

  • Fixed cache to store prompts at .html instead of .yaml
  • SubIncorrect and SubWait now include fields for wait times.
  • Re-implemented submission result parsers using attoparsec

Version 0.1.1.0

December 7, 2018

https://github.com/mstksg/advent-of-code-api/releases/tag/v0.1.1.0

  • More robust parser for submission results. Also now reports “hints” if possible.

Version 0.1.0.0

December 5, 2018

https://github.com/mstksg/advent-of-code-api/releases/tag/v0.1.0.0

  • Initial Release