summaryrefslogtreecommitdiff
path: root/api/violette.php
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-03-30 23:40:33 +0100
commit6b796258d413f00e498ce7f80f73a9f6c061f29c (patch)
tree49e64a5dd4cde2acff7f0a93ed3f8e20e1cb2dc8 /api/violette.php
parent5860551daa0f60103ad24e93da29f401a653f144 (diff)
downloadpluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.gz
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.tar.bz2
pluralconnect-6b796258d413f00e498ce7f80f73a9f6c061f29c.zip
Updated 5 files, added 2 files, deleted 495 files and renamed 7 files (automated)
Diffstat (limited to 'api/violette.php')
-rw-r--r--api/violette.php25
1 files changed, 9 insertions, 16 deletions
diff --git a/api/violette.php b/api/violette.php
index 1f6f4f0..52a0566 100644
--- a/api/violette.php
+++ b/api/violette.php
@@ -1,23 +1,16 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
+$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/gdapd/members.json"), true);
$data = [
- "count" => 0,
- "ponies" => []
+ "count" => count($list),
+ "ponies" => array_values(array_map(function ($i) {
+ return [
+ "url" => $i["avatar_url"] ?? null,
+ "label" => $i["display_name"] ?? $i["name"]
+ ];
+ }, $list))
];
-$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
+die(json_encode($data, JSON_PRETTY_PRINT));