feat: Add new tools api route
All checks were successful
Build Docker / BuildImage (push) Successful in 52s

This commit is contained in:
2025-10-26 18:20:03 +11:00
parent 8f774ba8f0
commit b089b8c0a8
2 changed files with 28 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ import datetime
import requests import requests
import re import re
from mail import sendEmail from mail import sendEmail
from tools import getClientIP, getGitCommit, json_response, parse_date from tools import getClientIP, getGitCommit, json_response, parse_date, get_tools_data
from blueprints.sol import sol_bp from blueprints.sol import sol_bp
from dateutil import parser as date_parser from dateutil import parser as date_parser
@@ -164,6 +164,21 @@ def project():
"status": HTTP_OK "status": HTTP_OK
}) })
@api_bp.route("/tools")
def tools():
"""Get a list of tools used by Nathan Woodburn."""
try:
tools = get_tools_data()
except Exception as e:
print(f"Error getting tools data: {e}")
return json_response(request, "500 Internal Server Error", HTTP_SERVER_ERROR)
# Remove demo and move demo_url to demo
for tool in tools:
if "demo_url" in tool:
tool["demo"] = tool.pop("demo_url")
return json_response(request, {"tools": tools}, HTTP_OK)
@api_bp.route("/page_date") @api_bp.route("/page_date")
def page_date(): def page_date():

View File

@@ -34,42 +34,48 @@
"type": "terminal", "type": "terminal",
"url": "https://fx.wtf/", "url": "https://fx.wtf/",
"description": "A command-line JSON viewer and processor", "description": "A command-line JSON viewer and processor",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/cx8sr8adsP6Uoi9zpg8MYnVTl.js\" id=\"asciicast-cx8sr8adsP6Uoi9zpg8MYnVTl\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/4.js\" id=\"asciicast-4\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/4"
}, },
{ {
"name": "Zoxide", "name": "Zoxide",
"type": "terminal", "type": "terminal",
"url": "https://github.com/ajeetdsouza/zoxide", "url": "https://github.com/ajeetdsouza/zoxide",
"description": "cd but with fuzzy matching and other cool features", "description": "cd but with fuzzy matching and other cool features",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/5.js\" id=\"asciicast-5\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/5.js\" id=\"asciicast-5\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/5"
}, },
{ {
"name": "Atuin", "name": "Atuin",
"type": "terminal", "type": "terminal",
"url": "https://atuin.sh/", "url": "https://atuin.sh/",
"description": "A next-generation shell history manager", "description": "A next-generation shell history manager",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/6.js\" id=\"asciicast-6\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/6.js\" id=\"asciicast-6\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/6"
}, },
{ {
"name": "Tmate", "name": "Tmate",
"type": "terminal", "type": "terminal",
"url": "https://tmate.io/", "url": "https://tmate.io/",
"description": "Instant terminal sharing", "description": "Instant terminal sharing",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/7.js\" id=\"asciicast-7\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/7.js\" id=\"asciicast-7\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/7"
}, },
{ {
"name": "Eza", "name": "Eza",
"type": "terminal", "type": "terminal",
"url": "https://eza.rocks/", "url": "https://eza.rocks/",
"description": "A modern replacement for 'ls'", "description": "A modern replacement for 'ls'",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/8.js\" id=\"asciicast-8\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/8.js\" id=\"asciicast-8\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/8"
}, },
{ {
"name": "Bat", "name": "Bat",
"type": "terminal", "type": "terminal",
"url": "https://github.com/sharkdp/bat", "url": "https://github.com/sharkdp/bat",
"description": "A cat clone with syntax highlighting and Git integration", "description": "A cat clone with syntax highlighting and Git integration",
"demo": "<script src=\"https://asciinema.c.woodburn.au/a/9.js\" id=\"asciicast-9\" async=\"true\"></script>" "demo": "<script src=\"https://asciinema.c.woodburn.au/a/9.js\" id=\"asciicast-9\" async=\"true\"></script>",
"demo_url": "https://asciinema.c.woodburn.au/a/9"
}, },
{ {
"name": "Oh My Zsh", "name": "Oh My Zsh",