FeedsOPMLParser.inc in Feeds 7
Same filename and directory in other branches
OPML Parser plugin.
File
plugins/FeedsOPMLParser.incView source
<?php
/**
* @file
* OPML Parser plugin.
*/
/**
* Feeds parser plugin that parses OPML feeds.
*/
class FeedsOPMLParser extends FeedsParser {
/**
* Implements FeedsParser::parse().
*/
public function parse(FeedsImportBatch $batch, FeedsSource $source) {
feeds_include_library('opml_parser.inc', 'opml_parser');
$result = opml_parser_parse($batch
->getRaw());
$batch
->setTitle($result['title']);
$batch
->setItems($result['items']);
}
/**
* Return mapping sources.
*/
public function getMappingSources() {
return array(
'title' => array(
'name' => t('Feed title'),
'description' => t('Title of the feed.'),
),
'xmlurl' => array(
'name' => t('Feed URL'),
'description' => t('URL of the feed.'),
),
) + parent::getMappingSources();
}
}
Classes
Name![]() |
Description |
---|---|
FeedsOPMLParser | Feeds parser plugin that parses OPML feeds. |