Fix sorting in advent of code cronjob. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 7c8441e80aee45ade235f86af5c5817ada000032 | |
parent 95b6d24de78f66f8cdbf380e1c02eab4ad2ff655 | |
Author: Annna Robert-Houdin <[email protected]> | |
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(-) | |
--- | |
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}" |