scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

commit 3fe83c0f2f7e6e3d87ede77607cca5922fa02a60
parent 90d1382761b9bf4b7e43517e40baa64a801f3b1a
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Fri, 28 Nov 2025 15:55:51 +0100

Added script to download advent of code input files

Diffstat:
MMakefile | 1+
Aaocd | 13+++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git 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 @@ -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