aoc2024/get_input.sh

25 lines
433 B
Bash
Executable File

#!/bin/bash -eu
cd "$(dirname $(realpath $0))"
. .env
d=${1-$(date +%d)}
e=$(bc <<< "$d + 0")
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/$e/input"
cp ../starter.py part1.py
echo $(realpath .)