From 29459d538623610e32fa2e841d72d927454cf67d Mon Sep 17 00:00:00 2001 From: Felix Blanke Date: Tue, 19 Sep 2023 19:46:38 +0200 Subject: [PATCH] Add endpoint that only returns the total number --- wsgi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wsgi.py b/wsgi.py index e7ce794..4518b04 100644 --- a/wsgi.py +++ b/wsgi.py @@ -431,5 +431,13 @@ def dashboard(): ) +@app.route("/total") +@cache.cached(timeout=60) +def total_result(url: str = "https://beschaeftigtenbefragung.verdi.de/"): + df, df_state, curr_datetime = get_tables(url) + total = df_state["Digitale Befragung"].sum().item() + return f"{total}" + + if __name__ == "__main__": app.run()