Skip to content

Instantly share code, notes, and snippets.

@voidhawk42
Created December 2, 2020 07:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voidhawk42/19bc13b59354ba5b20cea2314230c1fd to your computer and use it in GitHub Desktop.
Save voidhawk42/19bc13b59354ba5b20cea2314230c1fd to your computer and use it in GitHub Desktop.
pget←{
(year pnum)←⍕¨⍵
path←'C:\aocapl\',year,'\in\',pnum,'.txt' ⍝ Replace with your problem input storage path
⎕NEXISTS path:⊃⎕NGET path 1
cookie←⊃⊃⎕NGET'c:\aoc2020apl\cookie.txt' 1 ⍝ Place cookie in this file
url←'https://adventofcode.com/',year,'/day/',pnum,'/input'
resp←HttpCommand.Get url''('cookie'cookie)
(⎕UCS 10)(≠⊆⊢)resp.Data⊣resp.Data ⎕NPUT path 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment