From 0c2c40c76f78cf8807d49e3aa77b6aa9fa151fe6 Mon Sep 17 00:00:00 2001 From: nathansmith Date: Sat, 29 Mar 2025 03:24:52 -0600 Subject: Working on blog --- blog/articles/test.xml | 8 ++++++++ blog/feed.xml | 31 +++++++++++++++++++++++++++++ blog/generate.py | 30 +++++++++++++++++++++++++++++ blog/template.html | 46 ++++++++++++++++++++++++++++++++++++++++++++ images/crush_capitalism.png | Bin 0 -> 433 bytes images/icon.png | Bin 0 -> 5546 bytes images/linux_powered.gif | Bin 0 -> 14619 bytes images/ublock_now.png | Bin 0 -> 5152 bytes index.html | 6 ++++++ 9 files changed, 121 insertions(+) create mode 100644 blog/articles/test.xml create mode 100644 blog/feed.xml create mode 100755 blog/generate.py create mode 100644 blog/template.html create mode 100644 images/crush_capitalism.png create mode 100644 images/icon.png create mode 100644 images/linux_powered.gif create mode 100644 images/ublock_now.png diff --git a/blog/articles/test.xml b/blog/articles/test.xml new file mode 100644 index 0000000..51d440b --- /dev/null +++ b/blog/articles/test.xml @@ -0,0 +1,8 @@ +
+
+

Over thinking

+

+ I over think a lot tbh. +

+
+
diff --git a/blog/feed.xml b/blog/feed.xml new file mode 100644 index 0000000..a504f41 --- /dev/null +++ b/blog/feed.xml @@ -0,0 +1,31 @@ + + + + Nathan's shitty blog + The coffee powered blog of chaos + http://nathansmith117.beevomit.org/blog + + http://nathansmith117.bevomit.org/images/icon.png + Nathan's shitty blog + http://nathansmith117.beevomit.org + + + + test post + http://nathansmith117.bevomit.or/blog + Sat, 29 Mar 2025 00:00:00 GMT + + +
+

Over thinking

+

+ I over think a lot tbh. +

+
+ + ]]> +
+
+
+
diff --git a/blog/generate.py b/blog/generate.py new file mode 100755 index 0000000..3471ef9 --- /dev/null +++ b/blog/generate.py @@ -0,0 +1,30 @@ +#! /usr/bin/python3 + +""" +A script to generate html from the rss feed +""" + +import xml.etree.ElementTree as et + +def main(): + tree = et.parse("feed.xml") + root = tree.getroot() + channel = root[0] + + template = "" + + # Open html template + with open("template.html", "r") as fp: + template = fp.read() + + # Get articles from rss + for item in channel.findall("item"): + article = item.find("description").text + + # Remove article tags. + article = article[article.find("
")+9::] + article = article[:article.find("
"):] + print(article) + +if __name__ == "__main__": + main() diff --git a/blog/template.html b/blog/template.html new file mode 100644 index 0000000..719d3f3 --- /dev/null +++ b/blog/template.html @@ -0,0 +1,46 @@ + + + + + Nathan's shitty blog + + + + + + + + Back to home page + +
+ + + + +
+

Nathan's shitty blog

+

+

+
+ + + {articles} +
+ + diff --git a/images/crush_capitalism.png b/images/crush_capitalism.png new file mode 100644 index 0000000..df2add2 Binary files /dev/null and b/images/crush_capitalism.png differ diff --git a/images/icon.png b/images/icon.png new file mode 100644 index 0000000..b531864 Binary files /dev/null and b/images/icon.png differ diff --git a/images/linux_powered.gif b/images/linux_powered.gif new file mode 100644 index 0000000..2dbe456 Binary files /dev/null and b/images/linux_powered.gif differ diff --git a/images/ublock_now.png b/images/ublock_now.png new file mode 100644 index 0000000..c82555b Binary files /dev/null and b/images/ublock_now.png differ diff --git a/index.html b/index.html index dd28d1c..16d80fe 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ Nathan's Shitty Web +