mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-08-08 22:42:55 -04:00
Improve donation section: non-js modals
This commit is contained in:
parent
dad5ec8d11
commit
479b770b2b
3 changed files with 142 additions and 5 deletions
23
kycnot.py
23
kycnot.py
|
@ -13,8 +13,8 @@ from random import randrange
|
|||
import ruamel.yaml
|
||||
import datetime
|
||||
import os.path
|
||||
import httpx
|
||||
import qrcode
|
||||
import httpx
|
||||
import os
|
||||
import re
|
||||
|
||||
|
@ -62,6 +62,7 @@ async def about(request):
|
|||
r = httpx.get(
|
||||
"https://codeberg.org/schylza/schylza/raw/branch/main/SUPPORT.md")
|
||||
donations = yaml.load(r.content)
|
||||
await generate_donations_qrcodes(donations)
|
||||
return html(template.render(date=date, title="KYC? Not me!",
|
||||
subtitle="About KYCNOT.ME",
|
||||
support=donations))
|
||||
|
@ -164,6 +165,26 @@ async def gns(request):
|
|||
return text('POST request - {}'.format(request.json))
|
||||
return(html(template.render()))
|
||||
|
||||
async def generate_donations_qrcodes(donations):
|
||||
qr = qrcode.QRCode()
|
||||
qr.add_data(donations['xmr'])
|
||||
qr.make(fit=True)
|
||||
xmr = qr.make_image(fill_color="white", back_color=(26, 26, 26))
|
||||
|
||||
qr = qrcode.QRCode()
|
||||
qr.add_data(donations['btc'])
|
||||
qr.make(fit=True)
|
||||
btc = qr.make_image(fill_color="white", back_color=(26, 26, 26))
|
||||
|
||||
qr = qrcode.QRCode()
|
||||
qr.add_data(donations['nano'])
|
||||
qr.make(fit=True)
|
||||
nano = qr.make_image(fill_color="white", back_color=(26, 26, 26))
|
||||
|
||||
xmr.save("static/img/qrcodes/xmr.png")
|
||||
btc.save("static/img/qrcodes/btc.png")
|
||||
nano.save("static/img/qrcodes/nano.png")
|
||||
|
||||
async def get_trustpilot_info(service):
|
||||
r = httpx.get(
|
||||
f"https://www.trustpilot.com/review/{service['url'].replace('https://', '')[:-1]}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue