summaryrefslogtreecommitdiff
path: root/test/rss_creator.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/rss_creator.sh')
-rwxr-xr-xtest/rss_creator.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/rss_creator.sh b/test/rss_creator.sh
new file mode 100755
index 0000000..f30c0b1
--- /dev/null
+++ b/test/rss_creator.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+. ~/.config/b4rcms/basics.sh
+
+echo '<?xml version="1.0" encoding="UTF-8" ?>'
+echo \ "<rss version=\"2.0\">
+
+<channel>
+ <title>B4rkod's Basement</title>
+ <link>https://b4rkod.net.tr/rss.xml</link>
+ <description>My Basement's Window</description>
+ <!--item-->]> "
+
+for LINE in $( tac $DB/blogposts.txt ); do
+ DATE=$(date -d @$(echo $LINE | cut -c -10) -R)
+ BASE=$(echo $LINE| cut -c 12-)
+ FILE=$(cat $ROOT/blogposts/$BASE)
+ echo \ "
+<item>
+ <pubDate>$DATE</pubDate>
+ <guid>https://b4rkod.net.tr/$BASE</guid>
+ <title>$BASE</title>
+ <link>https://b4rkod.net.tr/blogposts/$BASE</link>
+ <description><![CDATA[
+ $FILE
+ ]]></description>
+</item>"
+
+done
+
+
+echo \ "
+</channel>
+</rss>
+"
+
+