3 namespace Friendica\Module\WellKnown;
5 use Friendica\BaseModule;
9 * Standardized way of exposing metadata about a server running one of the distributed social networks.
10 * @see https://github.com/jhass/nodeinfo/blob/master/PROTOCOL.md
12 class NodeInfo extends BaseModule
14 public static function rawContent(array $parameters = [])
16 self::printWellKnown();
20 * Prints the well-known nodeinfo redirect
22 * @throws \Friendica\Network\HTTPException\NotFoundException
24 private static function printWellKnown()
28 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
29 'href' => DI::baseUrl()->get() . '/nodeinfo/1.0'],
30 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0',
31 'href' => DI::baseUrl()->get() . '/nodeinfo/2.0'],
35 header('Content-type: application/json; charset=utf-8');
36 echo json_encode($nodeinfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);