#!/bin/sh set -eu day=${1:-$(date +%-d)} year=${2:-$(date +%Y)} mkdir -p data/"$year" curl -H 'User-Agent: https://github.com/doy/advent-of-code by adventofcode@tozt.net' -b "$(cat .cookie)" -s https://adventofcode.com/"$year"/day/"$day"/input >data/"$year"/"$day".txt