Here is a very basic FastAPI to get your server stats through the servers list to use on the platform of your choice such as website, discord server, etc...
The program scraps the data from Cfx.re Server List using Selenium and BeautifulSoup.
- Launches the website of the server.
- After DOM render, scraps the data using Beautiful soup.
- Returns the data.
/app/b/cfx/server
"id": string // the cfx.re id of your server, 3y5zzb by default.
"get_players": boolean // whether get online player names or not, false by default
"get_resources": boolean // whether get resource names or not, false by default
- Get your server id from Cfx.re Server List.
- Use
POST METHOD
to send query. The data provided must be in JSON format.
- Profit
I haven't managed to find a way to make module work after selenium web browser fully loads. Stackoverflow says its already set like that by default.
Maybe discord bot implementation, I haven't decided yet.