-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.sh
More file actions
14 lines (12 loc) · 546 Bytes
/
scripts.sh
File metadata and controls
14 lines (12 loc) · 546 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# based on script.sh from HyperNeutrino:
# https://github.com/hyper-neutrino/advent-of-code/blob/main/scripts.sh
export AOC_COOKIE=$(cat $(dirname $0)/cookie.txt) # get this from the cookies tab in network tools on the AOC website
function aoc-load () {
if [ $1 ]
then
curl --cookie "session=$AOC_COOKIE" https://adventofcode.com/$1/day/$2/input > input.txt
else
curl --cookie "session=$AOC_COOKIE" "$(echo `date +https://adventofcode.com/%Y/day/%d/input` | sed 's/\/0/\//g')" > input.txt
fi
cat input.txt
}