From a4d4376e857c21a2e21221a9b522e91c79740788 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 5 Mar 2023 09:42:52 +0100 Subject: Updated 2 files and added 3 files (automated) --- includes/backup.inc | 12 +++---- includes/pages.json | 10 ++++++ pages/api/plex-thumb.php | 11 ++++++ pages/api/plex.php | 90 ++++++++++++++++++++++++++++++++++++++++++++++++ pages/games.inc | 83 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 200 insertions(+), 6 deletions(-) create mode 100644 pages/api/plex-thumb.php create mode 100644 pages/api/plex.php create mode 100644 pages/games.inc diff --git a/includes/backup.inc b/includes/backup.inc index 361902b..6196389 100644 --- a/includes/backup.inc +++ b/includes/backup.inc @@ -81,10 +81,10 @@ copy("./data/backup.poniesbackup", "./data/encrypted/" . $id . ".poniesbackup"); echo(" Uploading to servers...\n"); -echo(" bridlewood... upload\n"); -exec("scp ./data/encrypted/" . $id . ".poniesbackup fedora@bridlewood.equestria.dev:/opt/ponies"); -echo(" bridlewood... cleaning up\n"); -exec('ssh fedora@bridlewood.equestria.dev bash /opt/clean.sh'); +echo(" zephyrheights... upload\n"); +exec("scp ./data/encrypted/" . $id . ".poniesbackup root@zephyrheights.equestria.dev:/opt/ponies"); +echo(" zephyrheights... cleaning up\n"); +exec('ssh root@zephyrheights.equestria.dev bash /opt/clean.sh'); echo(" canterlot... upload\n"); exec("scp ./data/encrypted/" . $id . ".poniesbackup root@canterlot.equestria.dev:/opt/ponies"); @@ -92,9 +92,9 @@ echo(" canterlot... cleaning up\n"); exec('ssh root@canterlot.equestria.dev bash /opt/clean.sh'); if (file_exists("/opt/ponies")) { - echo(" zephyrheights... copy\n"); + echo(" bridlewood... copy\n"); copy("./data/encrypted/" . $id . ".poniesbackup", "/opt/ponies/" . $id . ".poniesbackup"); - echo(" zephyrheights... cleaning up\n"); + echo(" bridlewood... cleaning up\n"); exec('bash -c "cd /opt/ponies; ls -tp | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); } diff --git a/includes/pages.json b/includes/pages.json index 2a7bbe6..8e21cc9 100644 --- a/includes/pages.json +++ b/includes/pages.json @@ -149,6 +149,16 @@ "limited": true, "rail": true }, + "games": { + "name": { + "en": "Equestria Games", + "fr": "Equestria Games" + }, + "short": null, + "admin": true, + "limited": true, + "rail": false + }, "government": { "name": { "en": "Government", diff --git a/pages/api/plex-thumb.php b/pages/api/plex-thumb.php new file mode 100644 index 0000000..4a20159 --- /dev/null +++ b/pages/api/plex-thumb.php @@ -0,0 +1,11 @@ + "Plex", + "avatar_url" => "https://support.plex.tv/wp-content/themes/plex/assets/img/favicons/plex-192.png", + "embeds" => [ + [ + "title" => formatTitle($payload["Metadata"]), + "type" => "rich", + "description" => formatSubtitle($payload["Metadata"]), + "color" => hexdec( "2b2d31" ), + "thumbnail" => [ + "url" => "https://ponies.equestria.horse/assets/cache/" . $id . ".jpg" + ], + "footer" => [ + "text" => $payload["Account"]["title"] . " · Playing from " . $payload["Player"]["title"], + "icon_url" => $payload["Account"]["thumb"] + ] + ] + ] + + ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); +} + +if (isset($hookObject)) { + $ch = curl_init(); + + curl_setopt_array( $ch, [ + CURLOPT_URL => $app["webhook"]["plex"], + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $hookObject, + CURLOPT_HTTPHEADER => [ + "Content-Type: application/json" + ] + ]); + + $response = curl_exec( $ch ); + curl_close( $ch ); +} \ No newline at end of file diff --git a/pages/games.inc b/pages/games.inc new file mode 100644 index 0000000..4df95f1 --- /dev/null +++ b/pages/games.inc @@ -0,0 +1,83 @@ + + + + +
+
+

51st Equestria Games

+

+ June 30th — July 6th
Maretime Bay, Equestria
+

+

+ Apply now
+ (applications open on April 1st until May 1st) +

+
+ Participating ponies (): " style="width: 24px;" title="" data-bs-toggle="tooltip" class="tooltip-nohelp"> +
+ +
+

List of games

+ +
+
Volleyball
+
Paddleboat
+
Magic
+
Swimming
+
Relay
+
+ +
+

Schedule

+ + +
+

How does it work?

+ + +
+

Rules

+ +
+ + -- cgit