Drupal 8  8.0.2
DefaultParser Class Reference
Inheritance diagram for DefaultParser:

Public Member Functions

 parse (FeedInterface $feed)

Detailed Description

Defines a default parser implementation.

Parses RSS, Atom and RDF feeds.

( id = "aggregator", title = ("Default parser"), description = ("Default parser for RSS, Atom and RDF feeds.") )

Member Function Documentation

parse ( FeedInterface  $feed)

{Parses feed data.

\Drupal\aggregator\FeedInterface$feedAn object describing the resource to be parsed. $feed->source_string->value contains the raw feed data. Parse the data and add the following properties to the $feed object:
  • description: The human-readable description of the feed.
  • link: A full URL that directly relates to the feed.
  • image: An image URL used to display an image of the feed.
  • etag: An entity tag from the HTTP header used for cache validation to determine if the content has been changed.
  • modified: The UNIX timestamp when the feed was last modified.
  • items: An array of feed items. The common format for a single feed item is an associative array containing:
    • title: The human-readable title of the feed item.
    • description: The full body text of the item or a summary.
    • timestamp: The UNIX timestamp when the feed item was last published.
    • author: The author of the feed item.
    • guid: The global unique identifier (GUID) string that uniquely identifies the item. If not available, the link is used to identify the item.
    • link: A full URL to the individual feed item.
bool TRUE if parsing was successful, FALSE otherwise.

Implements ParserInterface.

References EntityInterface\label(), Drupal\service(), FeedInterface\setDescription(), FeedInterface\setImage(), FeedInterface\setWebsiteUrl(), and t().

Here is the call graph for this function:

The documentation for this class was generated from the following file: