summaryrefslogtreecommitdiff
path: root/bin/fetch_input.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/fetch_input.sh')
-rwxr-xr-xbin/fetch_input.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/fetch_input.sh b/bin/fetch_input.sh
index 76bdddd..3467871 100755
--- a/bin/fetch_input.sh
+++ b/bin/fetch_input.sh
@@ -37,12 +37,15 @@ if [ "${MODE}" = 'wget' ]; then
[ -e "input" ] || {
mkdir 'input'
+ authenticated_wget --output-document "input/page_${DEC}.html" \
+ "https://adventofcode.com/${YEAR}/day/${DEC}"
SETTINGS=$(authenticated_wget --output-document='-' \
"https://adventofcode.com/${YEAR}/settings")
USERNAME=$(echo "${SETTINGS}" |
sed -n 's#.*display_name.*checked.*<span>\(.*\)</span>.*#\1#p')
authenticated_wget --output-document "input/${USERNAME}" \
"https://adventofcode.com/${YEAR}/day/${DEC}/input"
+ elinks -dump "./input/page_${DEC}.html" >"input/page_${DEC}.txt"
}
elif [ "${MODE}" = 'aocdl' ]; then
# One could possibly use the golang implemenation instead of wget: