Haskell bindings for Advent of Code REST API. Caches and throttles requests automatically, and parses responses into meaningful data types.
Specify your requests with
AoCOpts, and run them with
-- 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.
The neatly exported bindings (handling cookies/authentication, cacheing, throttling) are in Advent.
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
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.
A Servant API (for integrating with servant for features like mock servers, documentation and low-level client methods) is also exported in Advent.API. The Servant API also parses into meaningful types, but lacks management of cookies/auth, cacheing, and throttling. Please use especially responsibly.
November 9, 2019
- Rewrote submission response parser using megaparsec for better errors
November 5, 2019
Dayconstructor from Advent
November 4, 2019
- Switch from libcurl to servant, which allows for shedding of external dependencies.
- Support leaderboard API with data type.
- Expose raw servant API and client functions, for those who want to build documentation or a mock server or low-level client.
December 8, 2018: BUGFIX Switched from taggy to tagsoup, after observing that taggy had some issues parsing 2018’s Day 8 challenge prompt.
December 8, 2018: BUGFIX Add CPP to deal with building issues on GHC 8.2
December 8, 2018: BUGFIX Fix cache directory to separate by year
December 7, 2018
- Fixed cache to store prompts at
SubWaitnow include fields for wait times.
- Re-implemented submission result parsers using attoparsec
December 7, 2018
- More robust parser for submission results. Also now reports “hints” if possible.
December 5, 2018
- Initial Release