XML_Feed_Parser
[ class tree: XML_Feed_Parser ] [ index: XML_Feed_Parser ] [ all elements ]

Class: XML_Feed_Parser_RSS2

Source Location: /XML_Feed_Parser-0.2.4alpha/Parser/RSS2.php

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_RSS2

This class handles RSS2 feeds.


Author(s):

Version:

  • 0.2.2 22nd September 2005

Methods


Child classes:

XML_Feed_Parser_RSS2Element
This class provides support for RSS 2.0 entries. It will usually be called by XML_Feed_Parser_RSS2 with which it shares many methods.

Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_Type

XML_Feed_Parser_Type::addBase()
getBase gets us the xml:base data. We then need to process that with regard to our current link. This function does that and returns the link in as complete a form as possible.
XML_Feed_Parser_Type::count()
This function will tell us how many times the element $type appears at this level of the feed.
XML_Feed_Parser_Type::getBase()
We will often need to extract the xml:base values that apply to a link. This method iterates through the heirarchy and extracts the relevant attributes, and then combines them.
XML_Feed_Parser_Type::getCategory()
There is no single way of declaring a category in RSS1 or Atom as there is in RSS2.
XML_Feed_Parser_Type::getDate()
Get a date construct. We use PHP's strtotime to return it as a unix datetime
XML_Feed_Parser_Type::getEntryByOffset()
Pretty fundamental!
XML_Feed_Parser_Type::getText()
Get a text construct.

Class Details

[line 31]
This class handles RSS2 feeds.


[ Top ]


Method Detail

getCategory   [line 151]

string|array|false getCategory( string $call, [array $arguments = array()])

The category element is a simple text construct which can occur any number of times. We allow access by offset or access to an array of results.

Overrides XML_Feed_Parser_Type::getCategory() (There is no single way of declaring a category in RSS1 or Atom as there is in RSS2.)

Parameters:

string   $call     for compatibility with our overloading
array   $arguments     - arg 0 is the offset, arg 1 is whether to return as array

[ Top ]

getCloud   [line 267]

array getCloud( )

The cloud element is rarely used. It is designed to provide some details of a location to update the feed.
  • Return: an array of the attributes of the element

[ Top ]

getEntryById   [line 130]

XML_Feed_Parser_RSS2Element getEntryById( string $id)

This is not really something that will work with RSS2 as it does not have clear restrictions on the global uniqueness of IDs. But we can emulate it by allowing access based on the 'guid' element.

Parameters:

string   $id     any valid ID.

[ Top ]

getImage   [line 174]

array|false getImage( )

Get details of the image associated with the feed.
  • Return: an array simply containing the child elements

[ Top ]

getLink   [line 291]

string getLink( int $offset, [string $attribute = 'href'], [array $params = array()])

In RSS2 a link is a text element but in order to ensure that we resolve URLs properly we have a special function for them. We maintain the parameter used by the atom getLink method, though we only use the offset parameter.

Parameters:

int   $offset     
string   $attribute     
array   $params     

[ Top ]

getSkipDays   [line 256]

array getSkipDays( )

The skipdays element provides a list of days on which this feed should not be checked. We return an array of those days.

[ Top ]

getSkipHours   [line 245]

array getSkipHours( )

The skiphours element provides a list of hourss on which this feed should not be checked. We return an array of those hours (integers, 24 hour clock)

[ Top ]

getSkips   [line 224]

array|false getSkips( string $tagName)

This is a general function used by both getSkipDays and getSkipHours. It simply returns an array of the values of the children of the appropriate tag.

Parameters:

string   $tagName     

[ Top ]

getTextInput   [line 202]

array|false getTextInput( )

The textinput element is little used, but in the interests of completeness...

[ Top ]


Documentation generated on Tue, 11 Oct 2005 11:05:28 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.