Same name and namespace in other branches
  1. 4.6.x modules/blogapi.module \blogapi_blogger_title()
  2. 4.7.x modules/blogapi.module \blogapi_blogger_title()
  3. 5.x modules/blogapi/blogapi.module \blogapi_blogger_title()

For the blogger API, extract the node title from the contents field.

File

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

Code

function blogapi_blogger_title(&$contents) {
  if (eregi('<title>([^<]*)</title>', $contents, $title)) {
    $title = strip_tags($title[0]);
    $contents = ereg_replace('<title>[^<]*</title>', '', $contents);
  }
  else {
    list($title, $contents) = explode("\n", $contents, 2);
  }
  return $title;
}