summaryrefslogtreecommitdiff
path: root/add_to_rss.sh
diff options
context:
space:
mode:
authorb4rkod <void@Asena.localdomain>2023-11-19 20:46:07 +0300
committerb4rkod <void@Asena.localdomain>2023-11-19 20:46:07 +0300
commita4ede211a2632ba2a3d515bf2cec26874807aa1c (patch)
tree0f0afac53f19491a68bfe71434edda26727e0278 /add_to_rss.sh
parent19bd1af357e9c16a3b666cd860a1b8b17330c652 (diff)
improvements(maybe)
Diffstat (limited to 'add_to_rss.sh')
-rwxr-xr-xadd_to_rss.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/add_to_rss.sh b/add_to_rss.sh
new file mode 100755
index 0000000..d1e5da7
--- /dev/null
+++ b/add_to_rss.sh
@@ -0,0 +1,7 @@
+BASE=$(basename $1|sed s/txt$/html/)
+FILE=$(cat $1|sed -E ':a;N;$!ba; s/\//\\\//g ; s/\r{0,1}\n/<\\\/p>/g;s/^/<p>/;')
+echo $BASE
+
+sed -i "/<\!--item-->/s/$/\n\<item><pubDate><\/pubDate><guid>https:\/\/b4rkod.net.tr\/$BASE<\/guid><title>$BASE<\/title><link>https:\/\/b4rkod.net.tr\/blogposts\/$BASE<\/link><description><![CDATA[$FILE]]><\/description><\/item>/" "$HOME/www/source/rss.xml"
+
+