diff options
Diffstat (limited to '')
| -rwxr-xr-x | aocd | 13 |
1 files changed, 0 insertions, 13 deletions
| @@ -1,13 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Download input from the Advent of Code website (https://adventofcode.com/). | ||
| 4 | # Requires setting an AOC_SESSION_COOKIE variable with a valid session cookie. | ||
| 5 | |||
| 6 | # usage: aocd [year n] | ||
| 7 | # If year and n are not specified, the current year and day are used. | ||
| 8 | |||
| 9 | YEAR="${1:-$(date +'%Y')}" | ||
| 10 | DAY="${2:-$(date +'%d' | sed 's/^0//')}" | ||
| 11 | URL="https://adventofcode.com/$YEAR/day/$DAY/input" | ||
| 12 | |||
| 13 | curl "$URL" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt | ||
