You are here

function blogapi_rsd in Drupal 5

Same name and namespace in other branches
  1. 4 modules/blogapi.module \blogapi_rsd()
  2. 6 modules/blogapi/blogapi.module \blogapi_rsd()
1 call to blogapi_rsd()
blogapi_blogapi in modules/blogapi/blogapi.module

File

modules/blogapi/blogapi.module, line 813
Enable users to post using applications that support XML-RPC blog APIs.

Code

function blogapi_rsd() {
  global $base_url;
  $xmlrpc = $base_url . '/' . 'xmlrpc.php';
  $base = url('', NULL, NULL, TRUE);
  $blogid = 1;

  # until we figure out how to handle multiple bloggers
  drupal_set_header('Content-Type: application/rsd+xml; charset=utf-8');
  print <<<__RSD__
<?xml version="1.0"?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
  <service>
    <engineName>Drupal</engineName>
    <engineLink>http://drupal.org/</engineLink>
    <homePageLink>{<span class="php-variable">$base</span>}</homePageLink>
    <apis>
      <api name="MetaWeblog" preferred="false" apiLink="{<span class="php-variable">$xmlrpc</span>}" blogID="{<span class="php-variable">$blogid</span>}" />
      <api name="Blogger" preferred="false" apiLink="{<span class="php-variable">$xmlrpc</span>}" blogID="{<span class="php-variable">$blogid</span>}" />
      <api name="MovableType" preferred="true" apiLink="{<span class="php-variable">$xmlrpc</span>}" blogID="{<span class="php-variable">$blogid</span>}" />
    </apis>
  </service>
</rsd>
__RSD__;
}