Add scripts to fetch single or calendar inputs

This commit is contained in:
Anders Englöf Ytterström 2023-12-09 21:12:34 +01:00
parent fb5a1b9381
commit afeae6623d
2 changed files with 17 additions and 0 deletions

8
fetch-calendar Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
for i in $(seq 1 25)
do
./fetch-input $1 $i $2
done

9
fetch-input Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
OUTPUT=$3/$(seq -f "%02g" $2 $2).txt
curl \
-o $OUTPUT \
"https://adventofcode.com/$1/day/$2/input" \
--compressed \
-H "Cookie: session=$AOCTOKEN" \