mirror of
https://github.com/friendica/friendica
synced 2025-04-22 01:10:13 +00:00
all endpoints are now working
This commit is contained in:
parent
feeec908d3
commit
8c7e5bb776
6 changed files with 285 additions and 24 deletions
38
src/Module/Following.php
Normal file
38
src/Module/Following.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Module/Following.php
|
||||
*/
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\User;
|
||||
|
||||
/**
|
||||
* ActivityPub Following
|
||||
*/
|
||||
class Following extends BaseModule
|
||||
{
|
||||
public static function init()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
if (empty($a->argv[1])) {
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
$owner = User::getOwnerDataByNick($a->argv[1]);
|
||||
if (empty($owner)) {
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
$page = defaults($_REQUEST, 'page', null);
|
||||
|
||||
$Following = ActivityPub::getFollowing($owner, $page);
|
||||
|
||||
header('Content-Type: application/activity+json');
|
||||
echo json_encode($Following);
|
||||
exit();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue