From 1481706ee8299b9e10004c776d6b5a709246b622 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 10 Dec 2022 11:06:12 +0100 Subject: add a script for fetching the input + examples --- prep.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 prep.sh diff --git a/prep.sh b/prep.sh new file mode 100755 index 0000000..33a99d8 --- /dev/null +++ b/prep.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -eu +set -o pipefail + +DAY=$1 +CURLOPTS=--no-progress-meter + +curl $CURLOPTS https://adventofcode.com/2022/day/$DAY | awk '/
/ {sub("", ""); CODE=1; IDX+=1} /<\/code>/ {CODE=0;} {if (CODE) print > sprintf("ex%d.in", IDX)}'
+curl $CURLOPTS -b ../cookie https://adventofcode.com/2022/day/$DAY/input > real.in
+echo "done :)"
--
cgit 1.4.1-2-gfad0