feat: Add tools curl page
All checks were successful
Build Docker / BuildImage (push) Successful in 55s
All checks were successful
Build Docker / BuildImage (push) Successful in 55s
This commit is contained in:
10
curl.py
10
curl.py
@@ -1,5 +1,5 @@
|
|||||||
from flask import render_template
|
from flask import render_template
|
||||||
from tools import error_response, getAddress
|
from tools import error_response, getAddress, get_tools_data
|
||||||
import os
|
import os
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
import requests
|
import requests
|
||||||
@@ -99,10 +99,8 @@ def curl_response(request):
|
|||||||
coinList.sort()
|
coinList.sort()
|
||||||
return render_template("donate_more.ascii",header=get_header(),
|
return render_template("donate_more.ascii",header=get_header(),
|
||||||
coins=coinList
|
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
|
# For other donation pages, fall back to ascii if it exists
|
||||||
if path.startswith("donate/"):
|
if path.startswith("donate/"):
|
||||||
coin = path.split("/")[1]
|
coin = path.split("/")[1]
|
||||||
@@ -110,6 +108,10 @@ def curl_response(request):
|
|||||||
if address != "":
|
if address != "":
|
||||||
return render_template("donate_coin.ascii",header=get_header(),coin=coin.upper(),address=address), 200, {'Content-Type': 'text/plain; charset=utf-8'}
|
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"):
|
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'}
|
return render_template(f"{path}.ascii",header=get_header()), 200, {'Content-Type': 'text/plain; charset=utf-8'}
|
||||||
|
|||||||
@@ -685,6 +685,8 @@ def resume_pdf():
|
|||||||
|
|
||||||
@app.route("/tools")
|
@app.route("/tools")
|
||||||
def tools():
|
def tools():
|
||||||
|
if isCurl(request):
|
||||||
|
return curl_response(request)
|
||||||
return render_template("tools.html", tools=get_tools_data())
|
return render_template("tools.html", tools=get_tools_data())
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|||||||
13
templates/tools.ascii
Normal file
13
templates/tools.ascii
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{{header}}
|
||||||
|
[1;36m───────────────────────────────────────────────[0m
|
||||||
|
[1;36m Tools [0m
|
||||||
|
[1;36m────────────[0m
|
||||||
|
|
||||||
|
Here are some of the tools I use regularly — most of them are open source! 🛠️
|
||||||
|
|
||||||
|
{% for tool in tools %}
|
||||||
|
[1;33m{{tool.name}}[0m
|
||||||
|
{{tool.description}}
|
||||||
|
Website: {{tool.url}}
|
||||||
|
{% if tool.demo_url %}Demo: {{tool.demo_url}}{% endif %}
|
||||||
|
{% endfor %}
|
||||||
Reference in New Issue
Block a user