summaryrefslogtreecommitdiff
path: root/rss.sh
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-02-01 16:38:43 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-02-01 16:38:43 +0000
commit0ba00eaa2e131c3fbc519d208ae2e04934f2da63 (patch)
tree24116150a67a333de6d265dee48fb28861dc33a3 /rss.sh
parenta9b9bc9b63ff106ec7a4afd6dd4c6b7865f47be9 (diff)
added rss
Diffstat (limited to 'rss.sh')
-rwxr-xr-xrss.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/rss.sh b/rss.sh
new file mode 100755
index 0000000..1dd1de6
--- /dev/null
+++ b/rss.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+blogfile="./blogs"
+link="https://seacrossedlovers.xyz/blogger/blogs/output"
+rss="./blogs/output/rss.xml"
+
+
+echo """
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+
+<channel>
+ <title>Thing 1's blog</title>
+ <link>${link}/index.html</link>
+ <description>Definatly exists</description>
+""" > $rss
+
+blogs=$(ls $blogfile/*.blog)
+for i in $blogs; do
+ out=$(echo $i | rev | cut -d '/' -f 1 | cut -d '.' -f 2- | rev)
+ contents=$(cat $i | head)
+
+ echo """
+ <item>
+ <title>${out}</title>
+ <link>${link}/${out}</link>
+ <description>${contents}
+ </description>
+ </item>
+ """ >> $rss
+done
+
+
+
+echo """
+</channel>
+</rss>
+""" >> $rss