diff --git a/app.py b/app.py index a8eee11..1106241 100644 --- a/app.py +++ b/app.py @@ -20,9 +20,11 @@ def create_app(): db.init_app(APP) migrate.init_app(APP, db, render_as_batch=True) + create_rss_feed() + @scheduler.task("interval", id="update", minutes=10) def update(): - create_rss_feed() + update_rss_feed() return APP @@ -30,7 +32,18 @@ def create_app(): def create_rss_feed(): print("creating rss feed") fg = FeedGenerator() + fg.id("http://crunk.website") + fg.title("Crunk website") + fg.author({"name": "John Doe", "email": "john@example.de"}) + fg.link(href="http://crunk.website", rel="alternate") + fg.subtitle("Some things crunk is doing!") + fg.link(href="http://crunk.website/test.atom", rel="self") + fg.language("en") atomfeed = fg.atom_str(pretty=True) rssfeed = fg.rss_str(pretty=True) - fg.atom_file("atom.xml") - fg.rss_file("rss.xml") + fg.atom_file("static/atom.xml") + fg.rss_file("static/rss.xml") + + +def update_rss_feed(): + print("updating rss feed") diff --git a/static/atom.xml b/static/atom.xml new file mode 100644 index 0000000..1c0ee52 --- /dev/null +++ b/static/atom.xml @@ -0,0 +1,2 @@ + +http://crunk.websiteCrunk website2023-10-02T19:08:59.272412+00:00John Doejohn@example.depython-feedgenSome things crunk is doing! \ No newline at end of file diff --git a/static/rss.xml b/static/rss.xml new file mode 100644 index 0000000..bf5e2f9 --- /dev/null +++ b/static/rss.xml @@ -0,0 +1,2 @@ + +Crunk websitehttp://crunk.website/test.atomSome things crunk is doing!http://www.rssboard.org/rss-specificationpython-feedgenenMon, 02 Oct 2023 19:08:59 +0000 \ No newline at end of file