aoc/get_input.sh
2022-12-02 06:53:34 -08:00

17 lines
345 B
Bash
Executable File

#!/usr/bin/env zsh
rm -rf input
for year in {2015..2022}; do
mkdir -p input/"$year"
for day in {1..25}; do
if [[ day -lt 10 ]]; then
d="0$day"
else
d="$day"
fi
url="https://adventofcode.com/$year/day/$day/input"
curl --cookie "session=$1" $url | perl -pe 'chomp if eof' > "input/$year/$d"
done
touch "input/$year/test"
done