Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
885 B

  1. <?php
  2. /**
  3. * @file src/Module/Following.php
  4. */
  5. namespace Friendica\Module;
  6. use Friendica\BaseModule;
  7. use Friendica\Core\System;
  8. use Friendica\Model\User;
  9. use Friendica\Protocol\ActivityPub;
  10. /**
  11. * ActivityPub Following
  12. */
  13. class Following extends BaseModule
  14. {
  15. public static function rawContent($parameters)
  16. {
  17. $a = self::getApp();
  18. // @TODO: Replace with parameter from router
  19. if (empty($a->argv[1])) {
  20. throw new \Friendica\Network\HTTPException\NotFoundException();
  21. }
  22. // @TODO: Replace with parameter from router
  23. $owner = User::getOwnerDataByNick($a->argv[1]);
  24. if (empty($owner)) {
  25. throw new \Friendica\Network\HTTPException\NotFoundException();
  26. }
  27. $page = $_REQUEST['page'] ?? null;
  28. $Following = ActivityPub\Transmitter::getFollowing($owner, $page);
  29. header('Content-Type: application/activity+json');
  30. echo json_encode($Following);
  31. exit();
  32. }
  33. }