stupid stupid discord crap

This commit is contained in:
floppydiskette 2024-09-28 01:19:50 +01:00
commit f47c6d1313
No known key found for this signature in database
2 changed files with 70 additions and 6 deletions

View file

@ -49,6 +49,10 @@ li:before {
padding-right: 5px;
}
ul.discord-widget > li::before {
content: "";
}
p,
ul,
pre {
@ -139,16 +143,24 @@ table.system-info tr td:first-child {
}
.page-container > div.sidebar {
border-left: 2px solid gray;
border-left: 2px solid var(--foreground);
padding-left: 10px;
}
.footer hr {
margin-top: 0;
border: none;
border-top: 2px solid gray;
border-top: 2px solid var(--foreground);
}
small {
line-height: 0;
}
div.indent {
padding-left: 1em;
}
div.sidebar li.offline {
opacity: 80%;
}

View file

@ -1,6 +1,34 @@
<?php
function getUsers()
$BOT_USERS = [
"Calypso",
"MerryBot",
"MathBot",
"GPT Assistant",
"Tatsu",
"Automated_Squirrel",
"IceCreamBeta",
"Dictionary",
"NotSoBot",
"Kainé",
"Birdbot",
"IceCreamBot",
"EasyPoll",
"TeXit",
"FredBoat♪♪",
"Ordis",
"Jikkeogi ⁞ 찌꺼기",
"Linux RSS Bot",
"Yappy, the GitLab Monitor",
"QuizBot",
"OkiDoki",
];
/**
* Returns a list of users on the server with "public_html" folders
* @return array Array of usernames
*/
function getUsers(): array
{
$usernames = array();
@ -19,8 +47,19 @@ function getUsers()
return $usernames;
}
/**
* Get the member list from the Discord widget API
* @return mixed Array of members
*/
function getDiscordWidget(): mixed
{
$json = json_decode(file_get_contents("https://discord.com/api/guilds/445821876183367680/widget.json"));
return $json->members;
}
// Execute the function and display results
$usernames = getUsers();
$members = getDiscordWidget();
?>
<!DOCTYPE html>
@ -43,8 +82,9 @@ $usernames = getUsers();
|___| |__| |_____|_____|_____|__|__|&#8203;|_____/|_____|\___/</pre>
</div>
<div class="section">
<p>Members</p>
<p><b>Members</b></p>
<ul class="members">
<?= count($usernames) == 0 ? "<li>Error Retrieving Users</li>" : "" ?>
<?php foreach ($usernames as $username) { ?>
<li><a href="/~<?= $username ?>">~<?= $username ?></a><?= $username == "amr" ? "*" : "" ?></li>
<?php } ?>
@ -54,7 +94,7 @@ $usernames = getUsers();
</small>
</div>
<div class="section">
<p>Services</p>
<p><b>Services</b></p>
<table class="services">
<tr>
<td><a href="https://git.frzn.dev">git.frzn.dev</a></td>
@ -103,7 +143,7 @@ $usernames = getUsers();
</small>
</div>
<div class="section">
<p>System Info</p>
<p><b>System Info</b></p>
<table class="system-info">
<tr>
<td>time:</td>
@ -116,6 +156,18 @@ $usernames = getUsers();
</table>
</div>
</div>
<div class="sidebar">
<p><b>Online Members</b></p>
<div class="indent">
<ul class="discord-widget">
<?php foreach ($members as $member) { ?>
<?php if (!in_array($member->username, $BOT_USERS)) { ?>
<li><?= $member->username ?></li>
<?php } ?>
<?php } ?>
</ul>
</div>
</div>
</div>
<div class="footer">
<hr>