You are here

function _parser_common_syndication_title in Feeds 6

Same name and namespace in other branches
  1. 8.2 libraries/common_syndication_parser.inc \_parser_common_syndication_title()
  2. 7.2 libraries/common_syndication_parser.inc \_parser_common_syndication_title()
  3. 7 libraries/common_syndication_parser.inc \_parser_common_syndication_title()

Prepare raw data to be a title

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

File

libraries/common_syndication_parser.inc, line 596
Downloading and parsing functions for Common Syndication Parser. Pillaged from FeedAPI 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,]+/', strip_tags($body));
    $title = implode(' ', array_slice($words, 0, 3));
  }
  return $title;
}