You are here

function _parser_common_syndication_title in FeedAPI 6

Same name and namespace in other branches
  1. 5 parser_common_syndication/parser_common_syndication.module \_parser_common_syndication_title()

Prepare raw data to be a title

3 calls to _parser_common_syndication_title()
_parser_common_syndication_atom10_parse in parser_common_syndication/parser_common_syndication.inc
Parse atom feeds.
_parser_common_syndication_RDF10_parse in parser_common_syndication/parser_common_syndication.inc
Parse RDF Site Summary (RSS) 1.0 feeds in RDF/XML format.
_parser_common_syndication_RSS20_parse in parser_common_syndication/parser_common_syndication.inc
Parse RSS2.0 feeds.

File

parser_common_syndication/parser_common_syndication.inc, line 757
Downloading and parsing functions for Common Syndication Parser

Code

function _parser_common_syndication_title($title, $body = FALSE) {
  if (empty($title) && !empty($body)) {

    // Explode to words and use the first 3 words.
    $words = preg_split("/[\\s,]+/", $body);
    $title = $words[0] . ' ' . $words[1] . ' ' . $words[2];
  }
  return $title;
}