commit 83b9e7ec3729dec9ee9e5344a90e4259cdabba59 parent 5f5d6a2ce83572db4509b4972db3493eedc8dc90 Author: breadcat <breadcat@users.noreply.github.com> Date: Wed, 30 Jul 2025 12:56:26 +0100 Update script to print sortable HTML instead of markdown Diffstat:
M | scripts/blog-duolingo-rank.nix | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/blog-duolingo-rank.nix b/scripts/blog-duolingo-rank.nix @@ -17,12 +17,12 @@ # 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}')'" - # check + rank_streak="$(printf %s "$page_source" | awk -F"[#><]" '/icon streak/{getline;print $15}')" # write echo -e "$i \e[32mdone\e[39m" echo -n "Appending ranks to page... " - echo "| $(date +%F) | $(date +%H:%M) | $rank_streak | $rank_lingot |" | tr -d \' >>"$post_file" + 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" echo -e "$i \e[32mdone\e[39m" lastmod "$post_file" '';