Newer
Older
Alex Barth
committed
<?php
/**
* @file
* OPML Parser plugin.
*/
/**
* Feeds parser plugin that parses OPML feeds.
*/
class FeedsOPMLParser extends FeedsParser {
/**
* Implements FeedsParser::parse().
Alex Barth
committed
*/
public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
Alex Barth
committed
feeds_include_library('opml_parser.inc', 'opml_parser');
$opml = opml_parser_parse($fetcher_result->getRaw());
$result = new FeedsParserResult($opml['items']);
Alex Barth
committed
$result->title = $opml['title'];
Alex Barth
committed
}
/**
* 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();
Alex Barth
committed
}