blob: 56809173f08152e3dffd3606e0b8f36a217ee597 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/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}.html</link>
<description>${contents}
</description>
</item>
""" >> $rss
done
echo """
</channel>
</rss>
""" >> $rss
|