\net_nemein_rss_fetch

RSS and Atom feed fetching class. Caches the fetched items as articles in net.nehmer.blog

Note, that the request data, for ease of use, already contains the L10n Databases of the Component and MidCOM itself located in this class. They are stored as 'l10n' and 'l10n_midcom'. Also available as 'config' is the current component configuration.

Summary

Methods
Properties
Constants
__construct()
__get()
__isset()
set_active_leaf()
add_stylesheet()
get_workflow()
get_parser()
raw_fetch()
fetch()
import()
import_item()
clean()
parse_item_author()
match_item_author()
$_component
$lasterror
$_i18n
$_l10n
$_l10n_midcom
$_config
No constants found
No protected methods found
No protected properties found
N/A
import_article()
find_author()
find_article()
apply_values()
_parse_parameters()
_parse_tags()
$_services
$_feed
$_guid_property
$_node
N/A

Properties

$_component

$_component : string

The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.

Type

string

$lasterror

$lasterror : 

The last error reported by SimplePie, if any

Type

$_i18n

$_i18n : \midcom_services_i18n

A handle to the i18n service.

Type

\midcom_services_i18n

$_l10n

$_l10n : \midcom_services_i18n_l10n

The components' L10n string database.

Type

\midcom_services_i18n_l10n

$_l10n_midcom

$_l10n_midcom : \midcom_services_i18n_l10n

The global MidCOM string database.

Type

\midcom_services_i18n_l10n

$_config

$_config : \midcom_helper_configuration

The current configuration.

Type

\midcom_helper_configuration

$_services

$_services : array

Array that holds the already instantiated services

Type

array

$_feed

$_feed : 

The feed object we're fetching

Type

$_guid_property

$_guid_property : 

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

Type

$_node

$_node : \midcom_db_topic

Current node we're importing to

Type

\midcom_db_topic

Methods

__construct()

__construct(\net_nemein_rss_feed_dba  $feed) 

Initializes the class with a given feed

Parameters

\net_nemein_rss_feed_dba $feed

__get()

__get(  $field) 

Parameters

$field

__isset()

__isset(  $field) 

Parameters

$field

set_active_leaf()

set_active_leaf(  $leaf_id) 

Parameters

$leaf_id

add_stylesheet()

add_stylesheet(string  $url, string  $media = false) 

Convenience shortcut for adding CSS files

Parameters

string $url

The stylesheet URL

string $media

The media type(s) for the stylesheet, if any

get_workflow()

get_workflow(string  $identifier, array  $options = array()) : \midcom\workflow\dialog

Parameters

string $identifier
array $options

Returns

\midcom\workflow\dialog

get_parser()

get_parser() : \SimplePie

Returns

\SimplePie

raw_fetch()

raw_fetch(string  $url) : \SimplePie

Actually fetch a feed

Parameters

string $url

The URL to fetch

Returns

\SimplePie

fetch()

fetch() 

Fetch given RSS or Atom feed

import()

import() 

Fetches and imports items in the feed

import_item()

import_item(\net_nemein_rss_parser_item  $item) 

Imports a feed item into the database

Parameters

\net_nemein_rss_parser_item $item

Feed item as provided by SimplePie

clean()

clean(array  $items) 

Cleans up old, removed items from feeds

Parameters

array $items

Feed item as provided by SimplePie

parse_item_author()

parse_item_author(\net_nemein_rss_parser_item  $item) : Array

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

Parameters

\net_nemein_rss_parser_item $item

Feed item as provided by SimplePie

Returns

Array —

Information found

match_item_author()

match_item_author(\net_nemein_rss_parser_item  $item) : \midcom_db_person

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

Parameters

\net_nemein_rss_parser_item $item

Feed item as provided by SimplePie

Returns

\midcom_db_person

Person object matched, or null

import_article()

import_article(\net_nemein_rss_parser_item  $item) 

Imports an item as a news article

Parameters

\net_nemein_rss_parser_item $item

apply_values()

apply_values(\midcom_db_article  $article, array  $values, array  $meta_values) 

Parameters

\midcom_db_article $article
array $values
array $meta_values

_parse_parameters()

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

Parses additional metadata in RSS item and sets parameters accordingly

Parameters

\midcom_core_dbaobject $article

Imported article

\net_nemein_rss_parser_item $item

Feed item as provided by SimplePie

_parse_tags()

_parse_tags(\midgard_article  $article,   $field = 'content') 

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

Parameters

\midgard_article $article

Imported article

$field