Added RSS support
This commit is contained in:
parent
82df7fafe2
commit
2e7d276eee
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -4,3 +4,6 @@
|
||||||
[submodule "feed_generator"]
|
[submodule "feed_generator"]
|
||||||
path = feed_generator
|
path = feed_generator
|
||||||
url = http://gitlab.vanten-s.com/vanten-s/feed_generator.git
|
url = http://gitlab.vanten-s.com/vanten-s/feed_generator.git
|
||||||
|
[submodule "feed_articles"]
|
||||||
|
path = feed_articles
|
||||||
|
url = http://gitlab.vanten-s.com/vanten-s/feed_articles.git
|
||||||
|
|
1
feed_articles
Submodule
1
feed_articles
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 6fa7f3096bcff1b65d735124c56da89facdeba10
|
|
@ -1 +1 @@
|
||||||
Subproject commit 73cc34940565aa2532fac3aa2662095d2535985a
|
Subproject commit a7d96ea52ffa42139ac5466b5ea7d5aa3ee7900b
|
2
frmWrk
2
frmWrk
|
@ -1 +1 @@
|
||||||
Subproject commit 72eff55c4c90d3c9d7a813cce26ee3ef3cca2f70
|
Subproject commit b454f70fbb366ad8b6ec84c8a6d3ca47549264f2
|
24
main.py
24
main.py
|
@ -1,13 +1,21 @@
|
||||||
import frmWrk.website
|
import frmWrk.website as website
|
||||||
import feed_generator
|
import feed_generator
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
webserver = website.WebServer("", 3000, "./src")
|
||||||
webserver = frmWrk.website.WebServer("", 3000, "./src/", overwrites={
|
|
||||||
"/rss.xml": (lambda path: feed_generator.make_rss_feed("feed_articles/",
|
|
||||||
"vanten-s",
|
|
||||||
"https://vanten-s.com/",
|
|
||||||
"Vantens personal feed"))}
|
|
||||||
)
|
|
||||||
|
|
||||||
webserver.start()
|
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()
|
||||||
|
|
||||||
|
|
20
src/rss.xml
Normal file
20
src/rss.xml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<rss version="2.0">
|
||||||
|
|
||||||
|
<channel>
|
||||||
|
<title>Vantens</title>
|
||||||
|
<link>https://vanten-s.com/</link>
|
||||||
|
<description>Vantens personal feed</description>
|
||||||
|
<item>
|
||||||
|
<title>First post</title>
|
||||||
|
<author>vanten-s@vanten-s.com</author>
|
||||||
|
<pubDate>04 08 2023 10:30:00 +0200</pubDate>
|
||||||
|
<description>
|
||||||
|
<h1>First post</h1>
|
||||||
|
<p>Hiii, I'm vanten and I will try to post here as often as possible</p>
|
||||||
|
</description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</channel>
|
||||||
|
|
||||||
|
</rss>
|
Loading…
Reference in a new issue