aoc/get_input.sh

17 lines
340 B
Bash
Raw Normal View History

2021-07-14 13:50:33 -07:00
#!/usr/bin/env bash
rm -rf input
2021-07-14 13:50:33 -07:00
for year in {2015..2020}; do
mkdir -p input/$year
2021-07-14 13:50:33 -07:00
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
2021-07-14 13:50:33 -07:00
done
touch input/$year/test
2021-07-14 13:50:33 -07:00
done