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

Class: XML_Feed_Parser_RSS2Element

Source Location: /XML_Feed_Parser-0.2.5alpha/Parser/RSS2Element.php

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_RSS2
      |
      --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.


Author(s):

Version:

  • Release: @package_version@

Methods


Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_RSS2

XML_Feed_Parser_RSS2::getCategory()
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.
XML_Feed_Parser_RSS2::getCloud()
The cloud element is rarely used. It is designed to provide some details of a location to update the feed.
XML_Feed_Parser_RSS2::getEntryById()
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.
XML_Feed_Parser_RSS2::getImage()
Get details of the image associated with the feed.
XML_Feed_Parser_RSS2::getLink()
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.
XML_Feed_Parser_RSS2::getSkipDays()
The skipdays element provides a list of days on which this feed should not be checked. We return an array of those days.
XML_Feed_Parser_RSS2::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)
XML_Feed_Parser_RSS2::getSkips()
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.
XML_Feed_Parser_RSS2::getTextInput()
The textinput element is little used, but in the interests of completeness...

Class: XML_Feed_Parser_Type

XML_Feed_Parser_Type::addBase()
Gets us the xml:base data and then processes that with regard to our current link.
XML_Feed_Parser_Type::combineBases()
We have other methods which will traverse the DOM and work out the different xml:base declarations we need to be aware of. We then need to combine them.
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::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.
XML_Feed_Parser_Type::processXHTMLAttributes()
We need a couple of methods to access XHTML content stored in feeds.
XML_Feed_Parser_Type::traverseNode()
We need a couple of methods to access XHTML content stored in feeds.

Class Details

[line 32]
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.


[ Top ]


Method Detail

getEnclosure   [line 105]

array|false getEnclosure( [int $offset = 0])

The RSS2 spec is ambiguous as to whether an enclosure element must be unique in a given entry. For now we will assume it needn't, and allow for an offset.

Parameters:

int   $offset     offset

[ Top ]

getGuid   [line 89]

string getGuid( )

guid is the closest RSS2 has to atom's ID. It is usually but not always a URI.

The one attribute that RSS2 can posess is 'ispermalink' which specifies whether the guid is itself dereferencable. Use of guid is not obligatory, but is advisable.

  • Return: the guid
  • Todo: Implement ispermalink support

[ Top ]

getSource   [line 131]

array|false getSource( )

source is an optional sub-element of item. Like atom:source it tells

us about where the entry came from (eg. if it's been copied from another feed). It is not a rich source of metadata in the same way as atom:source and while it would be good to maintain compatibility by returning an XML_Feed_Parser_RSS2 element, it makes a lot more sense to return an array.


[ Top ]


Documentation generated on Sat, 15 Oct 2005 11:30:13 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.