5 ms·
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.
by wodenokoto 2y ago
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.
- eddsolves 2y agoI 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!)
- yoyohello13 2y agoCopy your session token into .token then: curl "https://adventofcode.com/2024/day/$DAY/input https://adventofcode.com/2024/day/$DAY/input" --header "Cookie: $(cat .token)" > input.txt
- sva_ 2y agoYou could open the dev console in the browser and copy the curl command off the network tab
- hoistbypetard 2y agoThe command line tool included with this python library does just what you want once you paste your session token into an environment variable: https://github.com/wimglenn/advent-of-code-data https://github.com/wimglenn/advent-of-code-data
- ljouhet 2y agoYou can use Firefox: "Copy as cUrl" (https://superuser.com/a/1382425 https://superuser.com/a/1382425)
- Symbiote 2y agoAssuming you already opened it in a web browser, why not right click the page and choose "Save As"?
- tocariimaa 2y agoI 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