summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-28 20:53:06 +0100
committerMinteck <contact@minteck.org>2023-01-28 20:53:06 +0100
commitd458f19bf5e1646251a2a243b0ab819ef5221687 (patch)
tree795d3087f01eec6e6924df3e157240ffb975441c
parent4ab40100e560f0283879159769d169612d399b96 (diff)
downloadhorses-d458f19bf5e1646251a2a243b0ab819ef5221687.tar.gz
horses-d458f19bf5e1646251a2a243b0ab819ef5221687.tar.bz2
horses-d458f19bf5e1646251a2a243b0ab819ef5221687.zip
Updated 6 files (automated)
-rw-r--r--includes/addresses.php8
-rw-r--r--includes/main.php17
-rw-r--r--includes/projects.json13
-rw-r--r--includes/refresh.php14
-rw-r--r--includes/version.txt2
-rw-r--r--projects/index.php2
6 files changed, 32 insertions, 24 deletions
diff --git a/includes/addresses.php b/includes/addresses.php
index e5293c1..7f6a11b 100644
--- a/includes/addresses.php
+++ b/includes/addresses.php
@@ -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)); \ No newline at end of file
+return; \ No newline at end of file
diff --git a/includes/main.php b/includes/main.php
index 4cfecf9..c1aa9ae 100644
--- a/includes/main.php
+++ b/includes/main.php
@@ -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) {
diff --git a/includes/projects.json b/includes/projects.json
index 0781ed0..6486c2f 100644
--- a/includes/projects.json
+++ b/includes/projects.json
@@ -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"
} \ No newline at end of file
diff --git a/includes/refresh.php b/includes/refresh.php
index ee312c0..2e20412 100644
--- a/includes/refresh.php
+++ b/includes/refresh.php
@@ -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"]),
diff --git a/includes/version.txt b/includes/version.txt
index d637cce..9d4cc5e 100644
--- a/includes/version.txt
+++ b/includes/version.txt
@@ -1 +1 @@
-12.1.7 \ No newline at end of file
+12.1.8 \ No newline at end of file
diff --git a/projects/index.php b/projects/index.php
index 53e9841..1f6a7dc 100644
--- a/projects/index.php
+++ b/projects/index.php
@@ -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>