From afeae6623d1d26c4babd02acf9a69b72930bddc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Engl=C3=B6f=20Ytterstr=C3=B6m?= Date: Sat, 9 Dec 2023 21:12:34 +0100 Subject: [PATCH] Add scripts to fetch single or calendar inputs --- fetch-calendar | 8 ++++++++ fetch-input | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100755 fetch-calendar create mode 100755 fetch-input diff --git a/fetch-calendar b/fetch-calendar new file mode 100755 index 0000000..adb0202 --- /dev/null +++ b/fetch-calendar @@ -0,0 +1,8 @@ +#!/bin/bash + +for i in $(seq 1 25) +do + ./fetch-input $1 $i $2 +done + + diff --git a/fetch-input b/fetch-input new file mode 100755 index 0000000..791c53d --- /dev/null +++ b/fetch-input @@ -0,0 +1,9 @@ +#!/bin/bash + +OUTPUT=$3/$(seq -f "%02g" $2 $2).txt + +curl \ + -o $OUTPUT \ + "https://adventofcode.com/$1/day/$2/input" \ + --compressed \ + -H "Cookie: session=$AOCTOKEN" \