eutro
A package for fetching Advent of Code input.
procedure
yeardaysession:aoc-session?year:advent-year?day:advent-day?
If you are using this in your puzzle solution, use of the cache argument is highly recommended.
See aoc-request for information on session, caching and error handling.
procedure
yeardaysession:aoc-session?year:advent-year?day:advent-day?
See open-aoc-input .
value
Equivalent to (integer-in 125).
value
Equivalent to (and/c exact-integer? (>=/c 2015)).
This module also reprovides advent-year? and advent-day?
procedure
( aoc-submit sessionyeardaypartanswer)→string?
session:aoc-session?year:advent-year?day:advent-day?answer:any/c
answer will be formatted with display before being submitted.
Returns the string that the Advent of Code site returns, to be read by a human.
procedure
( aoc-submit* sessionyeardaypartanswer)→input-port?
session:aoc-session?year:advent-year?day:advent-day?answer:any/c
This is the HTML page that the site shows the user upon submitting an answer.
Procedures for making API requests. Reprovided by advent-of-code.
procedure
( aoc-session? x)→boolean?
x:any/c
Equivalent to string? .
struct
#:extra-constructor-namemake-exn:fail:aoc)status:string?
procedure
path...[ #:cachecachesession:aoc-session?path:any/c= #f
If post? is supplied, then it is POST-ed as the payload, otherwise a simple GET request is made.
The cache argument specifies how the data should be cached.
If cache is #f, then no caching is performed, meaning the HTTP request will be made to the website every time. This is the default.
If cache is a path-string? , then the provided path is used as the directory to cache requests in.
If cache is a #t, then (find-system-path 'cache-dir) is used as the directory to cache requests in.
Raises exn:fail:aoc if the request fails.
Meta and environment functions. Reprovided by advent-of-code.
procedure
value
procedure
Tries to read session-file , if it is less than one month old, otherwise interactively prompts the user to enter the session cookie themselves, and saves it in session-file for later.
This is meant to be used by interactive programs, since it reads from current-input-port and writes to current-output-port .