Compare commits

..

1 commit

Author SHA1 Message Date
floppydiskette
f47c6d1313
stupid stupid discord crap 2024-09-28 01:19:50 +01:00
2 changed files with 150 additions and 120 deletions

View file

@ -9,10 +9,6 @@
--links: #89b4fa; --links: #89b4fa;
} }
html, body {
height: 98%;
}
body { body {
background-color: var(--background); background-color: var(--background);
color: var(--foreground); color: var(--foreground);
@ -53,6 +49,10 @@ li:before {
padding-right: 5px; padding-right: 5px;
} }
ul.discord-widget > li::before {
content: "";
}
p, p,
ul, ul,
pre { pre {
@ -64,14 +64,6 @@ pre {
padding-bottom: 1em; padding-bottom: 1em;
} }
.content {
display: grid;
grid-template-columns: auto max-content;
grid-template-rows: 1fr;
grid-column-gap: 0px;
grid-row-gap: 0px;
}
.section { .section {
min-width: 20em; min-width: 20em;
width: max-content; width: max-content;
@ -89,10 +81,6 @@ ul.members li:before {
content: none; content: none;
} }
ul.members li.error {
color: lightcoral
}
ul.sidebar-links li:before { ul.sidebar-links li:before {
content: ">"; content: ">";
} }
@ -143,9 +131,11 @@ table.system-info tr td:first-child {
} }
.page-container { .page-container {
min-height: 100%;
display: grid; display: grid;
grid-template-rows: auto 1fr auto; grid-template-columns: 1fr 250px;
grid-template-rows: 1fr;
grid-column-gap: 0;
grid-row-gap: 0;
} }
.page-container > div { .page-container > div {
@ -153,16 +143,24 @@ table.system-info tr td:first-child {
} }
.page-container > div.sidebar { .page-container > div.sidebar {
border-left: 2px solid gray; border-left: 2px solid var(--foreground);
padding-left: 10px; padding-left: 10px;
} }
.footer hr { .footer hr {
margin-top: 0; margin-top: 0;
border: none; border: none;
border-top: 2px solid gray; border-top: 2px solid var(--foreground);
} }
small { small {
line-height: 0; line-height: 0;
} }
div.indent {
padding-left: 1em;
}
div.sidebar li.offline {
opacity: 80%;
}

232
index.php
View file

@ -1,6 +1,34 @@
<?php <?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(); $usernames = array();
@ -19,8 +47,19 @@ function getUsers()
return $usernames; 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 // Execute the function and display results
$usernames = getUsers(); $usernames = getUsers();
$members = getDiscordWidget();
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -35,112 +74,105 @@ $usernames = getUsers();
<body> <body>
<div class="page-container"> <div class="page-container">
<div>
<div class="header"> <div class="header">
<pre> <pre> _______ _____
_______ _____
| ___|.----.-----.-----.-----.-----.| \.-----.--.--. | ___|.----.-----.-----.-----.-----.| \.-----.--.--.
| ___|&#8203;| _| _ |-- __| -__| |&#8203;| -- | -__| | | | ___|&#8203;| _| _ |-- __| -__| |&#8203;| -- | -__| | |
|___| |__| |_____|_____|_____|__|__|&#8203;|_____/|_____|\___/</pre> |___| |__| |_____|_____|_____|__|__|&#8203;|_____/|_____|\___/</pre>
</div> </div>
<div class="content"> <div class="section">
<div> <p><b>Members</b></p>
<div class="section tor-notice"> <ul class="members">
<pre> <?= count($usernames) == 0 ? "<li>Error Retrieving Users</li>" : "" ?>
+----------------------------------------------------------------+ <?php foreach ($usernames as $username) { ?>
| This site is accessible via Tor! | <li><a href="/~<?= $username ?>">~<?= $username ?></a><?= $username == "amr" ? "*" : "" ?></li>
| <a href="http://frzndev32nhnla77oozhxhz5yzo4abldr6zbc4qkdh5hcyanizlxs2ad.onion/">frzndev32nhnla77oozhxhz5yzo4abldr6zbc4qkdh5hcyanizlxs2ad.onion</a> | <?php } ?>
+----------------------------------------------------------------+ </ul>
</pre> <small>
</div> * owner &amp; admin
</small>
<div class="section">
<p>Members</p>
<ul class="members">
<?php if (count($usernames) > 0) { ?>
<?php foreach ($usernames as $username) { ?>
<li><a href="/~<?= $username ?>">~<?= $username ?></a><?= $username == "amr" ? "*" : "" ?></li>
<?php } ?>
<?php } else { ?>
<li class="error">Error fetching members!</li>
<?php } ?>
</ul>
<small>
* owner &amp; admin
</small>
</div>
<div class="section">
<p>Services</p>
<table class="services">
<tr>
<td><a href="https://git.frzn.dev">git.frzn.dev</a></td>
<td>Forgejo<sup>1</sup></td>
<td>A lightweight git server (which is better than Gogs)</td>
</tr>
<tr>
<td><a href="https://p.frzn.dev">p.frzn.dev</a></td>
<td>fiche</td>
<td>A command line pastebin (similar to termbin)</td>
</tr>
<tr>
<td><a href="https://pb.frzn.dev">pb.frzn.dev</a></td>
<td>PrivateBin</td>
<td>A minimalist, open source online pastebin</td>
</tr>
<tr>
<td><a href="https://bitwarden.frzn.dev/">bitwarden.frzn.dev</a></td>
<td>Vaultwarden<sup>1</sup></td>
<td>A Bitwarden-compatible server written in Rust</td>
</tr>
<tr>
<td><a href="https://snowflake.torproject.org/">Snowflake</a></td>
<td></td>
<td>A web proxy server</td>
</tr>
<tr>
<td><a href="https://crypt.frzn.dev">crypt.frzn.dev</a></td>
<td>CryptPad</td>
<td>An open-source web-based encrypted suite of realtime collaborative editors</td>
</tr>
<tr>
<td>frzn.dev:64738</td>
<td>Mumble<sup>1,2</sup></td>
<td>A VoIP server</td>
</tr>
<tr>
<td><a href="https://irc.frozenelectronics.ca:8088/">frzn.dev:6697/6667</a></td>
<td>ZNC<sup>1</sup></td>
<td>An IRC bouncer</td>
</tr>
</table>
<small>
<sup>1</sup> Only available for existing members<br>
<sup>2</sup> Not running 24/7
</small>
</div>
</div>
<div>
<div class="section">
<p>System Info</p>
<table class="system-info">
<tr>
<td>time:</td>
<td><?= gmdate("l, j F Y g:i:s A (e)") ?></td>
</tr>
<tr>
<td>os:</td>
<td>Ubuntu GNU/Linux 24.04 (LTS)</td>
</tr>
</table>
</div>
</div>
</div> </div>
<div class="footer"> <div class="section">
<hr> <p><b>Services</b></p>
(c) frzn.dev 2018 - <?= date('Y') ?> / design and "backend" by <a href="/~roscoe">~roscoe</a> <table class="services">
<tr>
<td><a href="https://git.frzn.dev">git.frzn.dev</a></td>
<td>Forgejo<sup>1</sup></td>
<td>A lightweight git server (which is better than Gogs)</td>
</tr>
<tr>
<td><a href="https://p.frzn.dev">p.frzn.dev</a></td>
<td>fiche</td>
<td>A command line pastebin (similar to termbin)</td>
</tr>
<tr>
<td><a href="https://pb.frzn.dev">pb.frzn.dev</a></td>
<td>PrivateBin</td>
<td>A minimalist, open source online pastebin</td>
</tr>
<tr>
<td><a href="https://bitwarden.frzn.dev/">bitwarden.frzn.dev</a></td>
<td>Vaultwarden<sup>1</sup></td>
<td>A Bitwarden-compatible server written in Rust</td>
</tr>
<tr>
<td><a href="https://snowflake.torproject.org/">Snowflake</a></td>
<td></td>
<td>A web proxy server</td>
</tr>
<tr>
<td><a href="https://crypt.frzn.dev">crypt.frzn.dev</a></td>
<td>CryptPad</td>
<td>An open-source web-based encrypted suite of realtime collaborative editors</td>
</tr>
<tr>
<td>frzn.dev:64738</td>
<td>Mumble<sup>1,2</sup></td>
<td>A VoIP server</td>
</tr>
<tr>
<td><a href="https://irc.frozenelectronics.ca:8088/">frzn.dev:6697/6667</a></td>
<td>ZNC<sup>1</sup></td>
<td>An IRC bouncer</td>
</tr>
</table>
<small>
<sup>1</sup> Only available for existing members<br>
<sup>2</sup> Not running 24/7
</small>
</div> </div>
<div class="section">
<p><b>System Info</b></p>
<table class="system-info">
<tr>
<td>time:</td>
<td><?= gmdate("l, j F Y g:i:s A (e)") ?></td>
</tr>
<tr>
<td>os:</td>
<td>Ubuntu GNU/Linux 24.04 (LTS)</td>
</tr>
</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>
(c) frzn.dev 2018 - <?= date('Y') ?> / design and "backend" by <a href="/~floppy">~floppy</a>
</div> </div>
</body> </body>
</html> </html>