Coder Social home page Coder Social logo

essic / advent-of-code-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mstksg/advent-of-code-api

0.0 0.0 0.0 351 KB

Haskell bindings to Advent of Code REST API

Home Page: https://hackage.haskell.org/package/advent-of-code-api

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%

advent-of-code-api's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.