aoc2020/scripts/get-input

15 lines
470 B
Plaintext
Raw Normal View History

2020-12-01 21:33:57 +00:00
#!/usr/bin/env racket
#lang racket
(require net/http-client)
(define *year* "2020")
(command-line
#:program "get-input"
#:args (day)
(define-values [status headers content]
(http-sendrecv "adventofcode.com" (format "/~a/day/~a/input" *year* day)
#:ssl? #t
#:headers (list (format "Cookie: session=~a" (getenv "AOC_SESSION")))))
(call-with-output-file (build-path "inputs" day) (lambda (out) (copy-port content out))))