Class: SimpleRSS

As the name suggests, this is a simple class for fetching RSS data
from remote sources. It consists, so far, of a single method,
fetch(), which retrieves the source, and handles caching for you
as well, using the saf.Database.PropertySet package for doing so
(a simple but effective cache).

If you require post-rendering caching, that's for you to handle.



Properties


$doc


$error


$client

  • Access: public

The XML-RPC client object.


$errno

  • Access: public

The error number (faultCode) if an error occurs.


$name


$value

  • Access: public

Value of the attribute.


$version

  • Access: public

XML version. Default is 1.0


$encoding


$doctype

  • Access: public

May contain the entire DOCTYPE declaration tag, including the
< and >.


$root

  • Access: public

The root node of the XML document.


$filename

  • Access: public

If this object was read in from a file, it may be specified here.


$xquery

  • Access: public

If query() has been called, this will contain the XMLDocQuery object.


$content

  • Access: public

Content of the node.


$children = array ()


$attributes = array ()

  • Access: public

Array of attribute objects.


$comment

  • Access: public

Attach a comment to the node, which will appear as an XML comment
tag above the element.


$cdata = false

  • Access: public

Notes whether the contents of this node should be displayed as
a <![CDATA[ ... ]]> block.


$number = 0

  • Access: public

Contains the number of this node within its parent node. Numbers
only increase when more than one child has the same name.


$parent


$callbackStart = false

  • Access: public

The function or method to use as a callback for the start tag
of the current XML node.


$callbackEnd = false

  • Access: public

The function or method to use as a callback for the end tag
of the current XML node.


$callbackObject = false

  • Access: public

The object that contains the methods listed in $callbackStart
and $callbackEnd (if they are methods and not ordinary custom or built-in
PHP functions).


$propagateCallback = false

  • Access: public

Whether or not to propagate callback settings to new child
nodes upon their creation. Defaults to false.


$nodes


$condition

  • Access: private

If a condition token is found, this is set to an array containing
the 'operator' and the 'left' node set of the condition.


$rules = array ()


$current


$schema


$tags


$types = array ('text', 'empty', 'data')


$parser


$rule = 'required'


$err_line


$err_code


$err_byte


$err_colnum


$attrs = array ()


$type = false


$ns


$parents


$test

Return to Top



Methods


&fetch ($url, $expires = 'auto')

  • Access: public
  • Return: object

Fetches a remote XML document and returns an object structure
parsed by SloppyDOM. Returns false if there is a parsing
error, and sets the $error property with the error message.
$expires can be set to either 'auto' (the default), which
tries to discover the cache duration based on the
syn:updatePeriod and syn:updateFrequency values in the
feed itself, and defaults to 1 hour (3600 seconds) if they
are not present. If $expires is set to a number, that is
used as the number of seconds to cache the feed for.

Return to Top

Copyright © 2008 Sitellite CMS Project

Powered by Sitellite 5.0 Content Management System