summaryrefslogtreecommitdiff
path: root/src/technical_renaissance
diff options
context:
space:
mode:
Diffstat (limited to 'src/technical_renaissance')
-rw-r--r--src/technical_renaissance/app.py10
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)