Skip to content

Instantly share code, notes, and snippets.

@daisyUniverse
Last active April 24, 2024 19:54
Show Gist options
  • Save daisyUniverse/d94f8ba43cb27fc6830d3b7d62c3dd62 to your computer and use it in GitHub Desktop.
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
# 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