3 namespace Friendica\Module\WellKnown;
6 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 $app = self::getApp();
18 self::printWellKnown($app);
22 * Prints the well-known nodeinfo redirect
26 * @throws \Friendica\Network\HTTPException\NotFoundException
28 private static function printWellKnown(App $app)
32 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
33 'href' => $app->getBaseURL() . '/nodeinfo/1.0'],
34 ['rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0',
35 'href' => $app->getBaseURL() . '/nodeinfo/2.0'],
39 header('Content-type: application/json; charset=utf-8');
40 echo json_encode($nodeinfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);