Skip to content

Instantly share code, notes, and snippets.

@xpqz
Created December 8, 2021 16:05
Show Gist options
  • Select an option

  • Save xpqz/f699167a1df7cb8117cea2f277afba33 to your computer and use it in GitHub Desktop.

Select an option

Save xpqz/f699167a1df7cb8117cea2f277afba33 to your computer and use it in GitHub Desktop.
Fetch the data for a given AoC day
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
}
@xpqz
Copy link
Author

xpqz commented Dec 8, 2021

You need to find your session cookie and store it in a file first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment