RSS and Atom feed fetching class.

Caches the fetched items as articles in net.nehmer.blog or events in net.nemein.calendar

package net.nemein.rss

 Methods

__construct (\net_nemein_rss_feed_dba $feed)

Initializes the class with a given feed

Parameters

$feed

clean (array $items)

Cleans up old, removed items from feeds

Parameters

$items

arrayFeed item as provided by SimplePie

fetch ()

Fetch given RSS or Atom feed

get_parser ()

Static

import ()

Fetches and imports items in the feed

import_item (\net_nemein_rss_parser_item $item)

Imports a feed item into the database

Parameters

$item

\net_nemein_rss_parser_itemFeed item as provided by SimplePie

match_item_author (\net_nemein_rss_parser_item $item)

Parses author formats used by different feed standards and tries to match to persons in database.

Parameters

$item

\net_nemein_rss_parser_itemFeed item as provided by SimplePie

Returns

\midcom_db_personPerson object matched, or null

parse_item_author (\net_nemein_rss_parser_item $item)

Parses author formats used by different feed standards and and returns the information

Parameters

$item

\net_nemein_rss_parser_itemFeed item as provided by SimplePie

Returns

ArrayInformation found

raw_fetch (string $url)

Static method for actually fetching a feed
Static

Parameters

$url

stringThe URL to fetch

Returns

\SimplePie

_parse_parameters (\midcom_core_dbaobject $article, \net_nemein_rss_parser_item $item)

Parses additional metadata in RSS item and sets parameters accordingly

Parameters

$article

\midcom_core_dbaobjectImported article

$item

\net_nemein_rss_parser_itemFeed item as provided by SimplePie

_parse_tags (\midgard_article $article, $field)

Parses rel-tag links in article content and tags the object based on them

Parameters

$article

\midgard_articleImported article

$field

import_article (\net_nemein_rss_parser_item $item)

Imports an item as a news article

Parameters

$item

 Properties

 

mixed $lasterror

The last error reported by SimplePie, if any
 

\midcom_helper_datamanager2 $_datamanager

Datamanager for handling saves
 

mixed $_feed

The feed object we're fetching
 

mixed $_guid_property

Property of midcom_db_article we're using for storing the feed item GUIDs
 

\midcom_db_topic $_node

Current node we're importing to