From 064e0fd8c82b8e34f27090e5a77ac55940a283c5 Mon Sep 17 00:00:00 2001 From: nathansmith117 Date: Sat, 29 Mar 2025 05:52:09 -0600 Subject: Working on blog --- blog/articles/overthinking.xml | 18 ++++++++++ blog/articles/test.xml | 8 ----- blog/feed.xml | 26 +++++++++----- blog/generate.py | 31 ++++++++++++++++- blog/index.html | 79 ++++++++++++++++++++++++++++++++++++++++++ blog/template.html | 24 +++++++++---- 6 files changed, 162 insertions(+), 24 deletions(-) create mode 100644 blog/articles/overthinking.xml delete mode 100644 blog/articles/test.xml create mode 100644 blog/index.html (limited to 'blog') diff --git a/blog/articles/overthinking.xml b/blog/articles/overthinking.xml new file mode 100644 index 0000000..218710b --- /dev/null +++ b/blog/articles/overthinking.xml @@ -0,0 +1,18 @@ +
+

+ Whenver I decide to add something to this website I always overthink on how + to add the thing. In general I just overthink how I will do everything. It + slows me down. Right now I am overthinking trying to think what to write + and how to format it. I always end up doing way less when what I planned + on doing. My partner overthinks a lot to. We overthink together. + Though we overthink in different ways. I always end up going fuck this + and throwing together a terrible mess while he just ends up giving up + from the start. +

+ Overthinking is just as much of a power as it is a curse. It fuels my + ideas and thought process just as much as it slows me down. Its a quite + difficult weapon to use but still quite deadly indeed. +

+ Next time you overthink do what I do: eat junk food. +

+
diff --git a/blog/articles/test.xml b/blog/articles/test.xml deleted file mode 100644 index 51d440b..0000000 --- a/blog/articles/test.xml +++ /dev/null @@ -1,8 +0,0 @@ -
-
-

Over thinking

-

- I over think a lot tbh. -

-
-
diff --git a/blog/feed.xml b/blog/feed.xml index a504f41..54d986c 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -11,18 +11,28 @@ - test post + Overthinking http://nathansmith117.bevomit.or/blog - Sat, 29 Mar 2025 00:00:00 GMT + Sat, 29 Mar 2025 11:42:00 GMT -
-

Over thinking

-

- I over think a lot tbh. -

-
+

+ Whenver I decide to add something to this website I always overthink on how + to add the thing. In general I just overthink how I will do everything. It + slows me down. Right now I am overthinking trying to think what to write + and how to format it. I always end up doing way less when what I planned + on doing. My partner overthinks a lot to. We overthink together. + Though we overthink in different ways. I always end up going fuck this + and throwing together a terrible mess while he just ends up giving up + from the start. +

+ Overthinking is just as much of a power as it is a curse. It fuels my + ideas and thought process just as much as it slows me down. Its a quite + difficult weapon to use but still quite deadly indeed. +

+ Next time you overthink do what I do: eat junk food. +

]]>
diff --git a/blog/generate.py b/blog/generate.py index 3471ef9..09c2320 100755 --- a/blog/generate.py +++ b/blog/generate.py @@ -6,6 +6,24 @@ A script to generate html from the rss feed import xml.etree.ElementTree as et +# Generates a html table for the article +# I use table layout because fuck you +def make_article_table(article_info, article): + html_text = """ + + + +

{title}

--- {date}
{article}
+ """ + + html_text = html_text.format( + title=article_info["title"], + date=article_info["pubDate"], + article=article + ) + + return html_text + def main(): tree = et.parse("feed.xml") root = tree.getroot() @@ -17,14 +35,25 @@ def main(): with open("template.html", "r") as fp: template = fp.read() + article_html = "" + # Get articles from rss for item in channel.findall("item"): + article_info = { + "title": item.find("title").text, + "pubDate": item.find("pubDate").text + } + article = item.find("description").text # Remove article tags. article = article[article.find("
")+9::] article = article[:article.find("
"):] - print(article) + article_html += make_article_table(article_info, article) + + # Format the articles into the html + template = template.format(articles=article_html) + print(template) if __name__ == "__main__": main() diff --git a/blog/index.html b/blog/index.html new file mode 100644 index 0000000..3161591 --- /dev/null +++ b/blog/index.html @@ -0,0 +1,79 @@ + + + + + Nathan's shitty blog + + + + + + + + Back to home page + +
+ + + + +
+

Nathan's shitty blog

+ + rss + +

+ I dont know if I will post often but here you go fucking world! + There is no topic, just me posting whatever is on my mind. Add + the feed to your feedreader (you better have one) so you + can stay updated on the things on my mind. +

+
+ + + + + + +

Overthinking

--- Sat, 29 Mar 2025 11:42:00 GMT
+

+ Whenver I decide to add something to this website I always overthink on how + to add the thing. In general I just overthink how I will do everything. It + slows me down. Right now I am overthinking trying to think what to write + and how to format it. I always end up doing way less when what I planned + on doing. My partner overthinks a lot to. We overthink together. + Though we overthink in different ways. I always end up going fuck this + and throwing together a terrible mess while he just ends up giving up + from the start. +

+ Overthinking is just as much of a power as it is a curse. It fuels my + ideas and thought process just as much as it slows me down. Its a quite + difficult weapon to use but still quite deadly indeed. +

+ Next time you overthink do what I do: eat junk food. +

+
+ +
+ + + diff --git a/blog/template.html b/blog/template.html index 719d3f3..bd460fe 100644 --- a/blog/template.html +++ b/blog/template.html @@ -6,34 +6,44 @@ - Back to home page + Back to home page
-- cgit v1.2.3

Nathan's shitty blog

+ + rss +

+ I dont know if I will post often but here you go fucking world! + There is no topic, just me posting whatever is on my mind. Add + the feed to your feedreader (you better have one) so you + can stay updated on the things on my mind.