From 3fe83c0f2f7e6e3d87ede77607cca5922fa02a60 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 28 Nov 2025 15:55:51 +0100 Subject: Added script to download advent of code input files --- Makefile | 1 + aocd | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 aocd diff --git a/Makefile b/Makefile index b89bba2..f97e502 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ PREFIX = /usr/local SCRIPTS = 2fa \ + aocd \ battery-checknow \ battery-status \ clip \ diff --git a/aocd b/aocd new file mode 100755 index 0000000..cab4060 --- /dev/null +++ b/aocd @@ -0,0 +1,13 @@ +#!/bin/sh + +# Download input from the Advent of Code website (https://adventofcode.com/). +# Requires setting an AOC_SESSION_COOKIE variable with a valid session cookie. + +# usage: aocd [year n] +# If year and n are not specified, the current year and day are used. + +YEAR="${1:-$(date +'%Y')}" +DAY="${2:-$(date +'%d' | sed 's/^0//')}" +URL="https://adventofcode.com/$YEAR/day/$DAY/input" + +curl "$URL" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt -- cgit v1.3