commit c40f36107c3a6e9462d7b6218bf4421a654082f9 Author: george Date: Wed Nov 30 23:27:59 2022 +0000 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/fetchinput.sh b/fetchinput.sh new file mode 100755 index 0000000..3aa77a0 --- /dev/null +++ b/fetchinput.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# AOC_SESSION_COOKIE="samplecookie" ./fetchinput.sh 13 + +# defaults to current day unless specified day is passed in +DAY=`date +%d` +! [ "$1" = "" ] && printf "%d" $1 >/dev/null 2>&1 && DAY=$1 + +[ "$AOC_SESSION_COOKIE" = "" ] && echo "\$AOC_SESSION_COOKIE not set" && exit 1 +echo -e curl -i https://adventofcode.com/2022/day/$DAY/input --cookie "session=$AOC_SESSION_COOKIE" -o day`printf "%02d" $DAY`/input