Updated 6 files (automated)

mane
Mia Raindrops 2 months ago
parent 4ab40100e5
commit d458f19bf5
Signed by: Mia Raindrops
GPG Key ID: EFBDC68435A574B7

@ -1,9 +1,3 @@
<?php
$addresses = [];
$addresses["france"] = exec("./getip.sh zephyrheights.equestria.dev");
$addresses["germany"] = exec("./getip.sh bridlewood.equestria.dev");
$addresses["usa"] = exec("./getip.sh canterlot.equestria.dev");
file_put_contents("./data/addresses.json", json_encode($addresses, JSON_PRETTY_PRINT));
return;

@ -6,7 +6,7 @@
* using these could break things.
*/
function timeAgo($time): string {
function timeAgo($time, $perDay): string {
if (!is_numeric($time)) {
$time = strtotime($time);
}
@ -18,11 +18,7 @@ function timeAgo($time): string {
$difference = $now - $time;
if ($difference <= 10 && $difference >= 0) {
if ($french) {
return $tense_fr = "à l'instant";
} else {
return $tense = "now";
}
return $tense = "now";
} elseif ($difference > 0) {
$tense = "ago";
} else {
@ -36,7 +32,14 @@ function timeAgo($time): string {
$difference = round($difference);
$period = $periods[$j];
return "{$difference} {$period} {$tense}";
if (time() - $time < 86400) {
return "Today";
} elseif (time() - $time < 86400 * 2) {
return "Yesterday";
} else {
return "{$difference} {$period} {$tense}";
}
}
function rgbToHsl($R, $G, $B) {

@ -87,5 +87,16 @@
"potatogochi": "Potatogochi",
"delta": "Delta",
"delta-android": "Delta for Android",
"ponypush": "Ponypush"
"ponypush": "Ponypush",
"autopush": "Autopush",
"pluralwear": "Pluralwear",
"plex": "Custom Plex Client",
"booru": "Booru",
"nots": "Nots",
"ponywatch": "Ponywatch",
"izzybot-supervisor": "Izzy Moonbot Supervisor",
"mistytown": "Misty Town",
"mistyfetch": "Mistyfetch",
"pluralkitty": "PluralKitty",
"smart-cpu": "Smart CPU"
}

@ -6,14 +6,14 @@ $descriptions = json_decode(file_get_contents("./descriptions.json"), true);
$projects = [];
print("Gitea > equestria.dev\n");
$gitea = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/equestria.dev/repos?limit=1000"), true);
$gitea = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/equestria.dev/repos?limit=1000", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true);
foreach ($gitea as $project) {
print(" " . $project["name"] . "\n");
$languages = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/languages"), true);
$languages = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/languages", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true);
$readme_dl = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/contents/README.md"), true);
$commit = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/commits?limit=1"), true)[0];
$readme_dl = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/contents/README.md", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true);
$commit = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/equestria.dev/$project[name]/commits?limit=1", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true)[0];
if (isset($readme_dl)) {
$readme = base64_decode($readme_dl["content"]);
@ -42,13 +42,13 @@ foreach ($gitea as $project) {
print("Gitea > minteck.org\n");
$minteckorg = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/minteck.org/repos?limit=1000"), true);
$minteckorg = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/minteck.org/repos?limit=1000", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true);
foreach ($minteckorg as $project) {
print(" " . $project["name"] . "\n");
$languages = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/minteck.org/$project[name]/languages"), true);
$languages = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/minteck.org/$project[name]/languages", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true);
$commit = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/minteck.org/$project[name]/commits?limit=1"), true)[0];
$commit = json_decode(file_get_contents("https://git.equestria.dev/api/v1/repos/minteck.org/$project[name]/commits?limit=1", false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true)[0];
$projects[] = [
"id" => md5("minteck.org-gitea/" . $project["id"]),

@ -1 +1 @@
12.1.7
12.1.8

@ -135,7 +135,7 @@ require $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
</div>
<div class="fancy-card-footer">
<p style="margin-bottom: 0;" class="text-muted"><?= timeAgo($project["update"]) ?><?php if (count($project["languages"]) > 0): ?> · <?= implode(", ", array_keys($project["languages"])) ?><?php endif; ?></p>
<p style="margin-bottom: 0;" class="text-muted"><?= timeAgo($project["update"], true) ?><?php if (count($project["languages"]) > 0): ?> · <?= implode(", ", array_keys($project["languages"])) ?><?php endif; ?></p>
</div>
</div>
</div>

Loading…
Cancel
Save