From 6731d28548d38acaef5bd83c98f287b46457e2d4 Mon Sep 17 00:00:00 2001 From: xfnw Date: Sun, 11 Oct 2020 20:47:18 -0400 Subject: [PATCH] rss feed! --- .gitignore | 1 + template/page.html | 6 ++++++ xfwc | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1f91da3..1bdfd08 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ src src/ src/* *.html +*.rss diff --git a/template/page.html b/template/page.html index bb30379..5a4e39a 100644 --- a/template/page.html +++ b/template/page.html @@ -23,5 +23,11 @@ +

+ +
+RSS feed +
+ diff --git a/xfwc b/xfwc index 14fff15..9b4e407 100755 --- a/xfwc +++ b/xfwc @@ -1,5 +1,18 @@ #!/bin/bash +ABSURL="https://xfnw.ttm.sh/xfwc" + +cat < feed.rss + + + + +xfwc +$ABSURL/ +xfwc + +EOF + BOOPTMP=$(mktemp) TOTAL=$(ls src | wc -w) @@ -8,12 +21,20 @@ rm index.html ln -s $TOTAL.html index.html -for fn in $(ls src); do -NUM=$(echo "${fn%???}" | sed 's/[^0-9]*//g') +NUM=$TOTAL +for fn in $(ls -t src); do NEWF=$NUM.html -TITLE=$(echo ${fn%????} | sed 's/_/ /g; s/[0-9]*//g' | sed -e 's/[]$.*[\^]/\\&/g') +TITLE=$(echo ${fn%????} | sed 's/_/ /g' | sed -e 's/[]$.*[\^]/\\&/g') echo "rendering $NEWF..." +cat <> feed.rss + +$TITLE +$ABSURL/$NEWF +image #$NUM + +EOF + echo "$TITLE" > $BOOPTMP cp template/page.html $NEWF @@ -33,6 +54,13 @@ sed -i "s/LAST/"$TOTAL"/" $NEWF sed -i 's/PRE/#/; s/NEXT/#/' $NEWF +NUM=$(( NUM - 1 )) + done +cat <> feed.rss + + +EOF +