protected function FeedsSimplePieParser::createTitle in Feeds 6
Same name and namespace in other branches
- 7.2 plugins/FeedsSimplePieParser.inc \FeedsSimplePieParser::createTitle()
- 7 plugins/FeedsSimplePieParser.inc \FeedsSimplePieParser::createTitle()
Generate a title from a random text.
1 call to FeedsSimplePieParser::createTitle()
- FeedsSimplePieParser::parse in plugins/
FeedsSimplePieParser.inc - Implementation of FeedsParser::parse().
File
- plugins/
FeedsSimplePieParser.inc, line 221
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);
}