aoc2024/get_input.sh

25 lines
433 B
Bash
Raw Normal View History

2024-12-02 09:29:41 +00:00
#!/bin/bash -eu
cd "$(dirname $(realpath $0))"
. .env
2024-12-25 23:39:32 +00:00
d=${1-$(date +%d)}
2024-12-11 11:43:26 +00:00
e=$(bc <<< "$d + 0")
2024-12-02 09:29:41 +00:00
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 \
2024-12-11 11:43:26 +00:00
"https://adventofcode.com/2024/day/$e/input"
2024-12-02 09:29:41 +00:00
2024-12-25 23:39:32 +00:00
cp ../starter.py part1.py
2024-12-02 09:29:41 +00:00
echo $(realpath .)