From a4d4e15b67f9ed731ee5ceccfebc62a52a204c98 Mon Sep 17 00:00:00 2001
From: Joe
Date: Thu, 20 Apr 2023 17:22:31 +0200
Subject: up
---
.local/bin/idea | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
(limited to '.local/bin/idea')
diff --git a/.local/bin/idea b/.local/bin/idea
index 86335c8..0b12494 100755
--- a/.local/bin/idea
+++ b/.local/bin/idea
@@ -8,23 +8,33 @@ else
thought="$*"
fi
-thought="$(printf "%s" "${thought}" | sed '{s#^#\\t\\t\\t\\t\\t#;s#^\\t\\t\\t\\t\\t$#\\t\\t\\t\\t
\\\n\\t\\t\\t\\t#;s#$#\\#;}')"
-# thought="$(echo -n "${thought}" | sed '{s/$$/<\/p>\n
/;s/$/\\/;s/^/\\t\\t\\t\\t\\t/;};${s/
\\$/\\/;p;x;};1d')"
+thought_html="$(printf "%s" "${thought}" | sed '{s#^#\\t\\t\\t\\t\\t#;s#^\\t\\t\\t\\t\\t$#\\t\\t\\t\\t
\\\n\\t\\t\\t\\t#;s#$#\\#;}')"
date=$(date '+%a, %d %b %Y %H:%M')
html_fmt='\t\t\t\t
'"${date}"'
\
\t\t\t\t\
-'"${thought}"'
+'"${thought_html}"'
\t\t\t\t
\
'
+rss_fmt='\\t- \
+\t '"${date}"'\
+\t '"${date_rss}"'\
+\t http://jozan.org/thoughts.html\
+\t '"$(uuidgen)"'\
+\t '"${thought}"'\
+\t
+'
+
case $(hostname -s) in
mother|po-rbo) sed="sed -i" ;;
mars) sed="sed -i ''" ;;
esac
-$sed -e '/$/{n;s#^#'"${html_fmt}"'#;}' \
- "$HOME"/dev/web/joe-www/thoughts.html
-git -C "$HOME"/dev/web/joe-www add -u
-git -C "$HOME"/dev/web/joe-www commit -m "Thought: ${date}"
-git -C "$HOME"/dev/web/joe-www push
-
-vps
+$sed -e '/<\/channel>/i '"${rss_fmt}" \
+ "$HOME"/dev/web/joe-www/thoughts.xml
+#$sed -e '/$/{n;s#^#'"${html_fmt}"'#;}' \
+# "$HOME"/dev/web/joe-www/thoughts.html
+#git -C "$HOME"/dev/web/joe-www add -u
+#git -C "$HOME"/dev/web/joe-www commit -m "Thought: ${date}"
+#git -C "$HOME"/dev/web/joe-www push
+#
+#vps
--
cgit v1.2.3