bbbb
This commit is contained in:
parent
8a5df51c94
commit
ab47f4af3a
2 changed files with 6 additions and 4 deletions
|
@ -15,20 +15,20 @@ site_name = environ.get("SITE_NAME").strip()
|
|||
|
||||
def counter():
|
||||
print('fuc', flush=True)
|
||||
print(marseys.items(), flush=True)
|
||||
db = db_session()
|
||||
sorted_marseys = []
|
||||
index = 0
|
||||
for k, val in marseys.items():
|
||||
count = db.query(Comment.id).where(Comment.body.like(f'%:{k}:%')).count()
|
||||
sorted_marseys.append((k, val, count))
|
||||
index += 1
|
||||
index += 1
|
||||
print(f'{index}- {k}: {count}', flush=True)
|
||||
db.close()
|
||||
sorted_marseys = sorted(sorted_marseys, key=lambda x: x[2], reverse=True)
|
||||
|
||||
text = render_template("marseys.html", marseys=sorted_marseys)
|
||||
with open(f'files/templates/marseys.html', 'w+') as f: f.write(text)
|
||||
text = render_template("marseys.html", marseys=sorted_marseys)
|
||||
with open(f'sortedmarseys.txt', 'w+') as f: f.write(text)
|
||||
print('success', flush=True)
|
||||
|
||||
@app.get("/privacy")
|
||||
@auth_required
|
||||
|
@ -36,6 +36,7 @@ def privacy(v):
|
|||
return render_template("privacy.html", v=v)
|
||||
|
||||
@app.get("/marseys")
|
||||
@limited.limit(1/day)
|
||||
@admin_level_required(3)
|
||||
def emojis(v):
|
||||
if v.username == 'Aevann': gevent.spawn(counter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue