From 0a49d80013d7114c678beb24db34d0fb088e0b30 Mon Sep 17 00:00:00 2001 From: cashmere Date: Sat, 20 Jun 2026 00:03:51 +0200 Subject: app.py: add feed.opml router --- src/technical_renaissance/app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/technical_renaissance/app.py b/src/technical_renaissance/app.py index 5519027..fb1f316 100644 --- a/src/technical_renaissance/app.py +++ b/src/technical_renaissance/app.py @@ -66,6 +66,15 @@ async def random_user(_request: Request): return redirect(random.choice(users)["url"]) +@app.get("/feed.opml") +async def opml(_request: Request) -> Response: + return Response( + status_code=200, + headers={"Content-Type": "text/x-opml"}, + description=build_opml(), + ) + + def build_opml() -> str: opml = ElementTree.Element("opml", version="2.0") head = ElementTree.SubElement(opml, "head") @@ -83,4 +92,5 @@ def build_opml() -> str: ) return ElementTree.tostring(opml, encoding="unicode", xml_declaration=True) + app.start(host="127.0.0.1", port=8080) -- cgit v1.3.1