nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

commit aa0b40ecfb3ab1031119cc4a5baaea4630c3f996
parent fc4145a87e39dee23fa48e5fd009a05b80faaa66
Author: Peter <peter@minskio.co.uk>
Date:   Wed, 14 Oct 2026 17:04:18 +0100

duome website has changed

Diffstat:
Mscripts/blog-duolingo.nix | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/blog-duolingo.nix b/scripts/blog-duolingo.nix @@ -14,13 +14,12 @@ let } # process page_source="$(curl -s https://duome.eu/"$username")" - rank_lingot="$(printf %s "$page_source" | awk -F"[#><]" '/icon lingot/ {print $15}')" - rank_streak="$(printf %s "$page_source" | awk -F"[#><]" '/icon streak/{getline;print $15}')" + rank_streak="$(printf %s "$page_source" | grep -oP 'class="rank[^>]*><a[^>]*>#\K[0-9]+')" # write echo -e "$i \e[32mdone\e[39m" echo -n "Appending ranks to page... " sed -i '/<\/tbody><\/table>/d' "$post_file" - printf " <tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n</tbody></table>" "$(date +%F)" "$(date +%H:%M)" "$rank_streak" "$rank_lingot" >>"$post_file" + printf " <tr><td>%s</td><td>%s</td><td>%s</td><td></td></tr>\n</tbody></table>" "$(date +%F)" "$(date +%H:%M)" "$rank_streak" >>"$post_file" echo -e "$i \e[32mdone\e[39m" lastmod "$post_file" '';