Created
December 8, 2021 16:05
-
-
Save xpqz/f699167a1df7cb8117cea2f277afba33 to your computer and use it in GitHub Desktop.
Fetch the data for a given AoC day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aocd←{ | |
(year day)←⍵ | |
cookie←⊃⊃⎕NGET'/Users/stefan/.aoc'1 | |
h←⎕NEW HttpCommand | |
h.Headers←(1 2⍴'cookie' ('session=',cookie)) | |
h.URL←'https://adventofcode.com/',(⍕year),'/day/',(⍕day),'/input' | |
¯1↓(h.Run).Data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to find your session cookie and store it in a file first.