Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstksg/advent-of-code-api
Haskell bindings to Advent of Code REST API
https://github.com/mstksg/advent-of-code-api
Last synced: about 2 months ago
JSON representation
Haskell bindings to Advent of Code REST API
- Host: GitHub
- URL: https://github.com/mstksg/advent-of-code-api
- Owner: mstksg
- License: bsd-3-clause
- Created: 2018-12-04T23:59:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T19:54:51.000Z (about 1 year ago)
- Last Synced: 2024-05-02T00:12:01.919Z (8 months ago)
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/advent-of-code-api
- Size: 381 KB
- Stars: 14
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[advent-of-code-api][]
======================[![advent-of-code-api on Hackage](https://img.shields.io/hackage/v/advent-of-code-api.svg?maxAge=86400)](https://hackage.haskell.org/package/advent-of-code-api)
[![Build Status](https://travis-ci.org/mstksg/advent-of-code-api.svg?branch=master)](https://travis-ci.org/mstksg/advent-of-code-api)Haskell bindings for Advent of Code REST API. Caches and throttles requests
automatically, and parses responses into meaningful data types.[advent-of-code-api]: https://hackage.haskell.org/package/advent-of-code-api
Specify your requests with `AoC` and `AoCOpts`, and run them with
`runAoC`.Examples:
```haskell
-- 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.