You are here

protected function FeedsSimplePieParser::createTitle in Feeds 7.2

Same name and namespace in other branches
  1. 6 plugins/FeedsSimplePieParser.inc \FeedsSimplePieParser::createTitle()
  2. 7 plugins/FeedsSimplePieParser.inc \FeedsSimplePieParser::createTitle()

Generate a title from a random text.

1 call to FeedsSimplePieParser::createTitle()
FeedsSimplePieParser::parse in plugins/FeedsSimplePieParser.inc
Implements FeedsParser::parse().

File

plugins/FeedsSimplePieParser.inc, line 239
Contains FeedsSimplePieParser and related classes.

Class

FeedsSimplePieParser
Class definition for Common Syndication Parser.

Code

protected function createTitle($text = FALSE) {

  // Explode to words and use the first 3 words.
  $words = preg_split("/[\\s,]+/", $text);
  $words = array_slice($words, 0, 3);
  return implode(' ', $words);
}