friendica/src/Module/ReallySimpleDiscovery.php
2019-05-05 18:15:39 +02:00

55 lines
1.1 KiB
PHP

<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Util\XML;
/**
* Prints the rsd.xml
* @see http://danielberlinger.github.io/rsd/
*/
class ReallySimpleDiscovery extends BaseModule
{
public static function rawContent()
{
header('Content-Type: text/xml');
$app = self::getApp();
$xml = null;
echo XML::fromArray([
'rsd' => [
'@attributes' => [
'version' => '1.0',
'xmlns' => 'http://archipelago.phrasewise.com/rsd',
],
'service' => [
'engineName' => 'Friendica',
'engineLink' => 'http://friendica.com',
'apis' => [
'api' => [
'@attributes' => [
'name' => 'Twitter',
'preferred' => 'true',
'apiLink' => $app->getBaseURL(),
'blogID' => '',
],
'settings' => [
'docs' => [
'http://status.net/wiki/TwitterCompatibleAPI',
],
'setting' => [
'@attributes' => [
'name' => 'OAuth',
],
'false',
],
],
]
],
],
],
], $xml);
exit();
}
}