22 lines
391 B
Bash
22 lines
391 B
Bash
|
#!/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 .)
|