lets try a starter

This commit is contained in:
setop 2024-12-02 10:29:41 +01:00
parent b68f57c83c
commit 2f31d7d84f
2 changed files with 22 additions and 0 deletions

1
cmd.txt Normal file
View File

@ -0,0 +1 @@
command cd "$(./get_input.sh)" && less input

21
get_input.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash -eu
cd "$(dirname $(realpath $0))"
. .env
d=$(date +%d)
mkdir -p d${d}
cd d${d}
[ -s input ] || curl -fsS \
-A "${UA}" \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
--compressed \
-H 'Connection: close' \
-H "Cookie: session=$SESSION" \
-o input \
"https://adventofcode.com/2024/day/$(( $d + 0 ))/input"
echo $(realpath .)