From 0bed92995b4a971532504473f2ce5adbfba471cd Mon Sep 17 00:00:00 2001 From: frcroth Date: Mon, 18 Sep 2023 09:42:35 +0200 Subject: [PATCH] Add meta feed --- om-bistro/openmensa_server.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/om-bistro/openmensa_server.py b/om-bistro/openmensa_server.py index ea5a804..5627ccf 100644 --- a/om-bistro/openmensa_server.py +++ b/om-bistro/openmensa_server.py @@ -1,6 +1,6 @@ import datetime -from flask import Flask, make_response +from flask import Flask, make_response, Response from pdf_downloader import download_pdf from pdf_parser import parse_pdf @@ -9,6 +9,7 @@ last_download = datetime.date.fromtimestamp(0) + @app.route("/feed") def feed(): global last_download @@ -19,6 +20,27 @@ def feed(): return parse_pdf() +@app.route("/meta") +def meta(): + xml = """ + + + Schraders Bistro +
August-Bebel-Straße 26–53 14482 Potsdam
+ public + + https://openmensa.scm.io/feed + + +
+
+ """ + return Response(xml, mimetype="text/xml") + + @app.route("/health_check") def health_check(): return make_response("OK", 200)