Calculate follower numbers

merge-requests/5/head
Terence Eden 2024-02-24 11:21:56 +00:00
rodzic 2a694f8290
commit cf07fe0b58
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -185,11 +185,19 @@
}
function followers() {
global $server;
// The number of followers is self-reported
// You can set this to any number you like
// Get all the files
$follower_files = glob("data/followers/*.json");
// Number of posts
$totalItems = count( $follower_files );
$followers = array(
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://{$server}/followers",
"type" => "Collection",
"totalItems" => 0,
"totalItems" => $totalItems,
"items" => []
);
header( "Content-Type: application/activity+json" );