Re:Advent of Code 2024
by wodenokoto on Sunday December 01, 2024 @11:55AM
(#42289313)
People here are doing it in Common Lisp and C standard library, meanwhile I’m just sitting here trying to get a curl call to download the data file.
[ Parent
| on HN ]
I just copy and paste into a local text file, but I bet there’s a tool if you want to do it programmatically already (unless curl’ing is your idea of fun!)
Re:Advent of Code 2024
by yoyohello13 on Sunday December 01, 2024 @12:33PM
(#42289532)
Copy your session token into .token then:
curl "https://adventofcode.com/2024/day/$DAY/input" --header "Cookie: $(cat .token)" > input.txt
You could open the dev console in the browser and copy the curl command off the network tab
Re:Advent of Code 2024
by hoistbypetard on Sunday December 01, 2024 @12:56PM
(#42289680)
The command line tool included with this python library does just what you want once you paste your session token into an environment variable:
You can use Firefox: "Copy as cUrl" (https://superuser.com/a/1382425)
Assuming you already opened it in a web browser, why not right click the page and choose "Save As"?
Re:Advent of Code 2024
by tocariimaa on Sunday December 01, 2024 @05:02PM
(#42291059)
I have this script:
#!/bin/sh
set -e
curl "https://adventofcode.com/${YEAR:?}/day/${DAY:?}/input" --cookie "session=$(cat .token)"
then: YEAR=2024 DAY=1 ./aocdata