30 lines
695 B
Python
30 lines
695 B
Python
import frmWrk.website as website
|
|
import feed_generator
|
|
import markdown
|
|
import pathlib
|
|
from time import sleep
|
|
|
|
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})
|
|
|
|
webserver.start()
|
|
|
|
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()
|
|
|