summaryrefslogtreecommitdiffstats
path: root/bin/get-input
blob: e510e12dad74759eea6da193d57fda4bf841e7e0 (plain) (blame)
1
2
3
4
5
6
7
8
#!/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