]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ReallySimpleDiscovery.php
Merge pull request #7828 from nupplaphil/task/move_enotify
[friendica.git] / src / Module / ReallySimpleDiscovery.php
index 4c14d3c8373aadf28dcd7654b19574b709185124..7cf0db6c7b965d6ac4b4507d628ee74468b1e912 100644 (file)
@@ -3,7 +3,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\Core\Renderer;
+use Friendica\Util\XML;
 
 /**
  * Prints the rsd.xml
@@ -11,11 +11,45 @@ use Friendica\Core\Renderer;
  */
 class ReallySimpleDiscovery extends BaseModule
 {
-       public static function rawContent()
+       public static function rawContent(array $parameters = [])
        {
-               header ('Content-Type: text/xml');
-               $tpl = Renderer::getMarkupTemplate('rsd.tpl');
-               echo Renderer::replaceMacros($tpl);
+               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();
        }
 }