Last active
April 24, 2024 19:54
-
-
Save daisyUniverse/d94f8ba43cb27fc6830d3b7d62c3dd62 to your computer and use it in GitHub Desktop.
whoami - simple Flask server that returns who in a PluralKit system is fronting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# who am i ? | |
# Simple flask server that checks the current fronter of a system and returns their name | |
# Daisy Universe [Tr] | |
# 04 . 24 . 24 | |
from pluralkit import Client | |
from flask import Flask | |
from flask_cors import CORS, cross_origin | |
from threading import Thread, current_thread | |
import asyncio | |
loop = asyncio.get_event_loop() | |
app = Flask(__name__) | |
cors = CORS(app) | |
app.config['CORS_HEADERS'] = 'Content-Type' | |
async def getname(): | |
pk = Client("TOKEN") | |
return ''.join([m.name async for m in pk.get_fronters()]) | |
@app.route('/') | |
def default(): | |
wawa = loop.run_until_complete(getname()) | |
return wawa | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0', port=6969) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment