diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-02-01 16:38:43 +0000 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-02-01 16:38:43 +0000 |
commit | 0ba00eaa2e131c3fbc519d208ae2e04934f2da63 (patch) | |
tree | 24116150a67a333de6d265dee48fb28861dc33a3 /rss.sh | |
parent | a9b9bc9b63ff106ec7a4afd6dd4c6b7865f47be9 (diff) |
added rss
Diffstat (limited to 'rss.sh')
-rwxr-xr-x | rss.sh | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -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 |