summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-04-20 17:22:31 +0200
committerJoe <rrbo@proton.me>2023-04-20 17:22:31 +0200
commita4d4e15b67f9ed731ee5ceccfebc62a52a204c98 (patch)
tree569fc63715fbc0cdc68cc0f1d4f792518031e7e8 /.local/bin
parentup (diff)
downloaddotfiles-bsd-a4d4e15b67f9ed731ee5ceccfebc62a52a204c98.tar.gz
dotfiles-bsd-a4d4e15b67f9ed731ee5ceccfebc62a52a204c98.tar.bz2
dotfiles-bsd-a4d4e15b67f9ed731ee5ceccfebc62a52a204c98.tar.xz
dotfiles-bsd-a4d4e15b67f9ed731ee5ceccfebc62a52a204c98.tar.zst
dotfiles-bsd-a4d4e15b67f9ed731ee5ceccfebc62a52a204c98.zip
up
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/idea30
1 files changed, 20 insertions, 10 deletions
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</p>\\\n\\t\\t\\t\\t<p>#;s#$#\\#;}')"
-# thought="$(echo -n "${thought}" | sed '{s/$$/<\/p>\n<p>/;s/$/\\/;s/^/\\t\\t\\t\\t\\t/;};${s/<br>\\$/\\/;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</p>\\\n\\t\\t\\t\\t<p>#;s#$#\\#;}')"
date=$(date '+%a, %d %b %Y %H:%M')
html_fmt='\t\t\t\t<h3>'"${date}"'</h3>\
\t\t\t\t<p>\
-'"${thought}"'
+'"${thought_html}"'
\t\t\t\t</p>\
'
+rss_fmt='\\t<item>\
+\t <title>'"${date}"'</title>\
+\t <pubDate>'"${date_rss}"'</pubDate>\
+\t <link>http://jozan.org/thoughts.html</link>\
+\t <guid>'"$(uuidgen)"'</guid>\
+\t <description>'"${thought}"'</description>\
+\t</item>
+'
+
case $(hostname -s) in
mother|po-rbo) sed="sed -i" ;;
mars) sed="sed -i ''" ;;
esac
-$sed -e '/<!-- thoughts here -->$/{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 '/<!-- thoughts here -->$/{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