]> git.mxchange.org Git - friendica.git/blob - src/Module/Followers.php
Move Photo module, update Photo model
[friendica.git] / src / Module / Followers.php
1 <?php
2 /**
3  * @file src/Module/Followers.php
4  */
5 namespace Friendica\Module;
6
7 use Friendica\BaseModule;
8 use Friendica\Protocol\ActivityPub;
9 use Friendica\Core\System;
10 use Friendica\Model\User;
11
12 /**
13  * ActivityPub Followers
14  */
15 class Followers extends BaseModule
16 {
17         public static function rawContent()
18         {
19                 $a = self::getApp();
20
21                 if (empty($a->argv[1])) {
22                         System::httpExit(404);
23                 }
24
25                 $owner = User::getOwnerDataByNick($a->argv[1]);
26                 if (empty($owner)) {
27                         System::httpExit(404);
28                 }
29
30                 $page = defaults($_REQUEST, 'page', null);
31
32                 $followers = ActivityPub\Transmitter::getFollowers($owner, $page);
33
34                 header('Content-Type: application/activity+json');
35                 echo json_encode($followers);
36                 exit();
37         }
38 }