Fix sorting in advent of code cronjob. - annna - Annna the nice friendly bot.
HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
---
DIR commit 7c8441e80aee45ade235f86af5c5817ada000032
DIR parent 95b6d24de78f66f8cdbf380e1c02eab4ad2ff655
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Thu, 15 Dec 2022 08:15:58 +0100
Fix sorting in advent of code cronjob.
Diffstat:
M advent-of-code-cronjob-2022.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
DIR diff --git a/advent-of-code-cronjob-2022.sh b/advent-of-code-cronjob-2022.sh
@@ -4,8 +4,10 @@ export PATH="/home/annna/bin:$PATH"
aocuri="$(curl -s https://adventofcode.com/ \
| grep aria-label \
- | sed 's,.*href="\([^"]*\)".*,https://adventofcode.com\1,g' \
- | sort \
+ | sed 's,.*href="\([^"]*\)".*,\1,g' \
+ | cut -d'/' -f 4 \
+ | sort -n \
+ | sed 's,\(.*\),https://adventofcode.com/2022/day/\1,g' \
| tail -n 1)"
annna-say -c "#bitreich-en" "Today's advent of code challenge: ${aocuri}"