3 namespace Friendica\Module\WellKnown;
6 use Friendica\BaseModule;
10 * Standardized way of exposing metadata about a server running one of the distributed social networks.
11 * @see https://github.com/jhass/nodeinfo/blob/master/PROTOCOL.md
13 class NodeInfo extends BaseModule
15 public static function rawContent(array $parameters = [])
19 self::printWellKnown($app);
23 * Prints the well-known nodeinfo redirect
27 * @throws \Friendica\Network\HTTPException\NotFoundException
29 private static function printWellKnown(App $app)
33 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
34 'href' => $app->getBaseURL() . '/nodeinfo/1.0'],
35 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0',
36 'href' => $app->getBaseURL() . '/nodeinfo/2.0'],
40 header('Content-type: application/json; charset=utf-8');
41 echo json_encode($nodeinfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);