A dynamic website status page, showing uptime/downtime statistics for your Discord bot (and also websites!). This makes use of the Uptime Robot API for monitoring. [Made using PHP]
What you need? Remix this project and a monitor-specific API key generated by Uptime Robot for the bot that you want the status to be shown. Copy the token and paste it in line 4 of monitoring.php!
I think it is better to have a server to response with the data you need and then the API key would be stored in servers env variables so noone would be able to see it.
That is a good idea, but the whole code is written in PHP, so it is a big task to convert it into JavaScript. Also, I can’t GET using the Uptime Robot API, there are only POST request in the API documentation. Can you help?
The php-express package overrides env with its own values, which is why the env variables aren’t being passed to php. The package has pull requests to partially fix this, but they haven’t been merged, and the project is stagnant.
The fix is, to start a router script instead of serving all files. I’ve put a basic router script in, but it really needs a better one, I’ll update with it soon.
@mishavee, is that all? It worked well, and when I type https://discord-status-page.glitch.me/.env, it said 'could not find .env’ so that must be it, I guess
yes, it can work like that, if you move it to a different non- root directory, but otherwise, it is extremely difficult to tell php not to serve the .env file
Okay, you caught me, I’ll totally agree, but I was insisting on it being converted to JavaScript, since the PHP looked tedious. Later, I had to improve the PHP variables, because even that guy was using the older version of the Uptime Robot API! And since that was an act of plagiarism (all apologies here) from my side, I’ll remove that. Sorry @GhostSlayer, and I promise that I won’t copy projects any more! But in my defense, it was open-source, and I hadn’t completely plagiarized the whole project! Sorry for that once again.
Also, I think I should tell you this! This was not meant to be the project to be displayed here. I had read this article mentioned above several months back and I had been intending to create another project that would remix this project and pass .env values by sending a POST request to the Glitch API, but since I was deficient in the knowledge needed to create that (especially the Glitch API), I had satisfied myself by tweaking the original status page, and waiting for something like the Glitch API to be released. And when a documented version of the Glitch API was released recently, I’ve been trying how I could pass .env values. Also, I wanted to send emails for updates in the status, but again, I didn’t know how to create it at that time. And yes folks, the status page was made when I followed that article @GhostSlayer mentioned. And yes, I should have mentioned that (as well as this) earlier. Sorry for any trouble caused due to this. If you insist, I can pull back this project and revise it, until it’s no longer plagiarized in the future.
Sorry for the trouble caused everyone,
Khaleel Gibran