summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-26 19:34:34 +0200
committerRaindropsSys <contact@minteck.org>2023-06-26 19:34:34 +0200
commit25f3023ff36d3fc2afcba1f910372a19f95b69a5 (patch)
treef7083dbfd97b7a6edd7309b346ffad1ad4eea626 /pages
parent5a35cecdcd8658113102ae98fc04e764e0ee9ed0 (diff)
downloadpluralconnect-25f3023ff36d3fc2afcba1f910372a19f95b69a5.tar.gz
pluralconnect-25f3023ff36d3fc2afcba1f910372a19f95b69a5.tar.bz2
pluralconnect-25f3023ff36d3fc2afcba1f910372a19f95b69a5.zip
Updated includes/components/timeline.inc and added pages/api/violette.php (automated)
Diffstat (limited to 'pages')
-rw-r--r--pages/api/violette.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/pages/api/violette.php b/pages/api/violette.php
new file mode 100644
index 0000000..c1e3da8
--- /dev/null
+++ b/pages/api/violette.php
@@ -0,0 +1,23 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
+
+$data = [
+ "count" => 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://ponies.equestria.horse" . 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