From 5860551daa0f60103ad24e93da29f401a653f144 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 29 Mar 2024 22:05:35 +0100 Subject: Updated 20 files, added 6 files, deleted 144 files and renamed .idea/ponycule.iml (automated) --- api/_main.php | 30 ++++++++++++++++++++ api/pluralkit-integration.php | 64 +++++++++++++++++++++++++++++++++++++++++++ api/timeline.php | 12 ++++++++ api/violette.php | 23 ++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 api/_main.php create mode 100644 api/pluralkit-integration.php create mode 100644 api/timeline.php create mode 100644 api/violette.php (limited to 'api') diff --git a/api/_main.php b/api/_main.php new file mode 100644 index 0000000..215c1b2 --- /dev/null +++ b/api/_main.php @@ -0,0 +1,30 @@ + $system + ]); + createJob("UpdateAssets", [ + "type" => "members" + ]); +} + +if ($input["type"] === "UPDATE_SYSTEM") { + createJob("PKSystem", [ + "system" => $system + ]); + createJob("UpdateAssets", [ + "type" => "system" + ]); +} + +if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" || $input["type"] === "DELETE_SWITCH") { + createJob("PKFronters", [ + "system" => $system + ]); + createJob("PKSwitches", [ + "system" => $system + ]); + createJob("FrontersNotification", [ + "system" => $system + ]); +} diff --git a/api/timeline.php b/api/timeline.php new file mode 100644 index 0000000..8271b7a --- /dev/null +++ b/api/timeline.php @@ -0,0 +1,12 @@ + 0, + "ponies" => [] +]; + +$list = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd"); + +$data["count"] = count($list); +$data["ponies"] = array_values(array_filter(array_map(function ($i) { + return [ + "url" => "https://ponycule.p.equestria.dev" . getAsset("gdapd", $i["id"] ?? "", "heads"), + "label" => $i["display_name"] ?? $i["name"] + ]; +}, $list), function ($i) { + return isset($i["url"]) && getAsset("gdapd", $i["id"] ?? "", "heads") !== null; +})); + +header("Content-Type: application/json"); +die(json_encode($data, JSON_PRETTY_PRINT)); \ No newline at end of file -- cgit