vanten-s.com/main.py

30 lines
695 B
Python
Raw Normal View History

2023-08-05 10:42:22 +02:00
import frmWrk.website as website
2023-08-04 16:40:47 +02:00
import feed_generator
2023-09-05 15:22:39 +02:00
import markdown
import pathlib
2023-08-05 10:42:22 +02:00
from time import sleep
2023-08-04 16:40:47 +02:00
2023-09-05 15:22:39 +02:00
def article(path):
article_name = path.split("?")[1]
article_html = feed_generator.convert_markdown_to_html(pathlib.Path("feed_articles") / article_name)
return article_html[0]
webserver = website.WebServer("", 3000, "./src", overwrites={"/articles.html": article})
2023-08-01 21:04:58 +02:00
webserver.start()
2023-08-05 10:42:22 +02:00
while True:
feed = feed_generator.make_rss_feed("feed_articles", "Vantens", "https://vanten-s.com/", "Vantens personal feed")
with open("src/rss.xml", "w") as f:
f.write(feed)
try:
sleep(15)
except KeyboardInterrupt:
break
webserver.close()