aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile1
-rwxr-xr-xaocd13
2 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b89bba2..f97e502 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
1PREFIX = /usr/local 1PREFIX = /usr/local
2 2
3SCRIPTS = 2fa \ 3SCRIPTS = 2fa \
4 aocd \
4 battery-checknow \ 5 battery-checknow \
5 battery-status \ 6 battery-status \
6 clip \ 7 clip \
diff --git a/aocd b/aocd
new file mode 100755
index 0000000..cab4060
--- /dev/null
+++ b/aocd
@@ -0,0 +1,13 @@
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
9YEAR="${1:-$(date +'%Y')}"
10DAY="${2:-$(date +'%d' | sed 's/^0//')}"
11URL="https://adventofcode.com/$YEAR/day/$DAY/input"
12
13curl "$URL" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt

Generated with cgit - Back to sebastiano.tronto.net