You are here

class FeedsOPMLParser in Feeds 8.2

Same name and namespace in other branches
  1. 6 plugins/FeedsOPMLParser.inc \FeedsOPMLParser
  2. 7.2 plugins/FeedsOPMLParser.inc \FeedsOPMLParser
  3. 7 plugins/FeedsOPMLParser.inc \FeedsOPMLParser

Feeds parser plugin that parses OPML feeds.

Hierarchy

Expanded class hierarchy of FeedsOPMLParser

2 string references to 'FeedsOPMLParser'
feeds_news_feeds_importer_default in feeds_news/feeds_news.feeds_importer_default.inc
Implementation of hook_feeds_importer_default().
_feeds_feeds_plugins in ./feeds.plugins.inc
Break out for feeds_feed_plugins().

File

lib/Drupal/feeds/Plugin/feeds/parser/FeedsOPMLParser.php, line 11
OPML Parser plugin.

View source
class FeedsOPMLParser extends FeedsParser {

  /**
   * Implements FeedsParser::parse().
   */
  public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
    feeds_include_library('opml_parser.inc', 'opml_parser');
    $opml = opml_parser_parse($fetcher_result
      ->getRaw());
    $result = new FeedsParserResult($opml['items']);
    $result->title = $opml['title'];
    return $result;
  }

  /**
   * 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();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsOPMLParser::getMappingSources public function Return mapping sources.
FeedsOPMLParser::parse public function Implements FeedsParser::parse().