aoc/get_input.sh

17 lines
340 B
Bash
Executable File

#!/usr/bin/env bash
rm -rf input
for year in {2015..2020}; 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