diff options
| author | cashmere <cashmere@autistici.org> | 2026-06-20 00:03:51 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-06-20 00:03:51 +0200 |
| commit | 0a49d80013d7114c678beb24db34d0fb088e0b30 (patch) | |
| tree | 50c492f3855ff62597eb0953c7e29a0133b6e9ec | |
| parent | 92b87e4bc2261d1533b6443d1ec72b7589df2dd3 (diff) | |
| download | technical-renaissance-0a49d80013d7114c678beb24db34d0fb088e0b30.tar.gz | |
app.py: add feed.opml router
| -rw-r--r-- | src/technical_renaissance/app.py | 10 |
1 files changed, 10 insertions, 0 deletions
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) |
