blob: 3509e890ce0c09c8da2526315ca4ed57dfcdd3e5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
cd "$(dirname "$0")"
find . \
-mindepth 2 \
-maxdepth 2 \
-type d \
-regex '\./[0-9]\{4\}/[0-9]\{2\}' \
| sort \
| while IFS=/ read _ y d
do
file=$y/$d/input
[ -f "$file" ] && continue
>&2 printf 'Fetching %s/%s... ' $y $d
wget -q --load-cookies=.cookies -O "$file" \
"https://adventofcode.com/$y/day/${d#0}/input"
>&2 printf 'DONE\n' >&2
done
|