Calculate follower numbers
rodzic
2a694f8290
commit
cf07fe0b58
10
index.php
10
index.php
|
@ -185,11 +185,19 @@
|
||||||
}
|
}
|
||||||
function followers() {
|
function followers() {
|
||||||
global $server;
|
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(
|
$followers = array(
|
||||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||||
"id" => "https://{$server}/followers",
|
"id" => "https://{$server}/followers",
|
||||||
"type" => "Collection",
|
"type" => "Collection",
|
||||||
"totalItems" => 0,
|
"totalItems" => $totalItems,
|
||||||
"items" => []
|
"items" => []
|
||||||
);
|
);
|
||||||
header( "Content-Type: application/activity+json" );
|
header( "Content-Type: application/activity+json" );
|
||||||
|
|
Ładowanie…
Reference in New Issue