From 26f64e8610aa005bdef25812cbe79f30e56e2f96 Mon Sep 17 00:00:00 2001 From: Nyo Date: Tue, 31 May 2016 22:33:24 +0200 Subject: [PATCH] .BANCHO. Add /api/v1/onlineUsers --- pep.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pep.py b/pep.py index 6cd806a..fb9165e 100644 --- a/pep.py +++ b/pep.py @@ -111,7 +111,7 @@ def serverStatus(): }) @app.route("/api/v1/isOnline") -def apiUserOnline(): +def apiIsOnline(): username = request.args.get("u") if username == None: result = False @@ -122,6 +122,11 @@ def apiUserOnline(): "result": result }) +@app.route("/api/v1/onlineUsers") +def apiOnlineUsers(): + return flask.jsonify({ + "result": len(glob.tokens.tokens) + }) # Main bancho server @app.route("/", methods=['GET', 'POST'])