From abcaa9283dc820982183e2fc0f3e1930f0158d25 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 26 Oct 2025 18:19:49 +1100 Subject: [PATCH] feat: Add tools curl page --- curl.py | 10 ++++++---- server.py | 2 ++ templates/tools.ascii | 13 +++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 templates/tools.ascii diff --git a/curl.py b/curl.py index 81dd50d..b1ca116 100644 --- a/curl.py +++ b/curl.py @@ -1,5 +1,5 @@ from flask import render_template -from tools import error_response, getAddress +from tools import error_response, getAddress, get_tools_data import os from functools import lru_cache import requests @@ -99,10 +99,8 @@ def curl_response(request): coinList.sort() return render_template("donate_more.ascii",header=get_header(), coins=coinList - ), 200, {'Content-Type': 'text/plain; charset=utf-8'} + ), 200, {'Content-Type': 'text/plain; charset=utf-8'} - - # For other donation pages, fall back to ascii if it exists if path.startswith("donate/"): coin = path.split("/")[1] @@ -110,6 +108,10 @@ def curl_response(request): if address != "": return render_template("donate_coin.ascii",header=get_header(),coin=coin.upper(),address=address), 200, {'Content-Type': 'text/plain; charset=utf-8'} + if path == "tools": + tools = get_tools_data() + return render_template("tools.ascii",header=get_header(),tools=tools), 200, {'Content-Type': 'text/plain; charset=utf-8'} + if os.path.exists(f"templates/{path}.ascii"): return render_template(f"{path}.ascii",header=get_header()), 200, {'Content-Type': 'text/plain; charset=utf-8'} diff --git a/server.py b/server.py index 87c568a..b4ce245 100644 --- a/server.py +++ b/server.py @@ -685,6 +685,8 @@ def resume_pdf(): @app.route("/tools") def tools(): + if isCurl(request): + return curl_response(request) return render_template("tools.html", tools=get_tools_data()) # endregion diff --git a/templates/tools.ascii b/templates/tools.ascii new file mode 100644 index 0000000..cadaa2c --- /dev/null +++ b/templates/tools.ascii @@ -0,0 +1,13 @@ +{{header}} +─────────────────────────────────────────────── + Tools  +──────────── + +Here are some of the tools I use regularly — most of them are open source! 🛠️ + +{% for tool in tools %} +{{tool.name}} +{{tool.description}} +Website: {{tool.url}} +{% if tool.demo_url %}Demo: {{tool.demo_url}}{% endif %} +{% endfor %}