diff --git a/files/routes/static.py b/files/routes/static.py index 33e58c285..e6ed40519 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -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) diff --git a/sortedmarseys.txt b/sortedmarseys.txt new file mode 100644 index 000000000..2e65efe2a --- /dev/null +++ b/sortedmarseys.txt @@ -0,0 +1 @@ +a \ No newline at end of file