Skip to content

Instantly share code, notes, and snippets.

@Unihedro
Created December 1, 2020 05:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
my aoc input downloader.sh
#!/bin/bash
DAY=$(( $(date -d "$D" '+%d') ))
#DAY=9
echo "https://adventofcode.com/2020/day/$DAY/input"
while true;do
if [[ $(curl "https://adventofcode.com/2020/day/$DAY/input" -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'cookie: session=[my session cookie dun hack pls]' --compressed --output input -w "%{response_code}") != 404 ]]; then
stat input
head input
break
fi
sleep 3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment