advent-of-code-api: Advent of Code REST API bindings and servant API

[ bsd3, library, web ] [ Propose Tags ]

Haskell bindings for Advent of Code REST API and a servant API. Please use responsibly! See README.md or Advent module for an introduction and tutorial.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.2.1, 0.1.2.2, 0.1.2.3, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.2.1, 0.2.3.0, 0.2.4.0, 0.2.4.1, 0.2.4.2, 0.2.5.0, 0.2.6.0, 0.2.6.1, 0.2.6.2, 0.2.7.0 (info)
Change log CHANGELOG.md
Dependencies aeson, base (>=4.9 && <5), bytestring, containers, deepseq, directory, filepath, finite-typelits, http-api-data, http-client, http-client-tls, http-media, megaparsec (>=7), mtl, profunctors, servant, servant-client, servant-client-core, stm, tagsoup, text, time [details]
License BSD-3-Clause
Copyright (c) Justin Le 2018
Author Justin Le
Maintainer justin@jle.im
Category Web
Home page https://github.com/mstksg/advent-of-code-api#readme
Bug tracker https://github.com/mstksg/advent-of-code-api/issues
Source repo head: git clone https://github.com/mstksg/advent-of-code-api
Uploaded by jle at Mon Dec 2 09:04:05 UTC 2019
Distributions LTSHaskell:0.1.2.3, NixOS:0.2.2.0, Stackage:0.1.2.3
Downloads 1955 total (723 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for advent-of-code-api-0.2.5.0

[back to package description]

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, and parses responses into meaningful data types.

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.

The neatly exported bindings (handling cookies/authentication, cacheing, throttling) are in Advent.

Session Keys

Session keys are required for most commands, but if you enter a bogus key you should be able to get at least Part 1 from AoCPrompt. Session keys are also not needed for daily and global leaderboards.

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.

Servant API

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.