classRSSReader

The RSS Reader is a class created for the reading of XML files, particulary RSS Feeds. It uses the PHP XMLReader class and helps to make the reading of XML files more human friendly. It cuts down the need to properly process the feed information and organises it in a proper format for which people can use more efficiently. At the moments its only in the testing phase and is currently in use within the MyTwitterBB plugin for reading Twitter Feeds.

Download

Download Version 1.0
Released 01/11/2009

Use

To use the RSS Reader then download the file and place it in the website that you wish to run it from. (For example in the folder "includes") and then run this code:

require "include/rss_reader.class.php";
$rdr = new classRSSReader;

$rdr is the new name for the class for it to run the functions. To read a file just do this:

$rdr->readFile("rss_file.xml");

Developers

Class Variables

  • _strFileName - The name of the retrieved file
  • _objFeed - The Feed into which all information is recovered
  • _objCur - The current node for processing
  • _strCurrentNode - The name of the current node
  • _strParentNode - The parent of the current node
  • _objParentNodeCount - An array for the amount of times a node is used
  • _objFeedInformation - Some processing information for the current feed
  • _strErrroName - The name of the constant for the main error
  • _bolReadFeed - If true a feed has been read by the class.

Class Constants

  • RSS_READER_ERROR - An error has occured
  • RSS_READER_ERROR_OUTPUTNODE_NOPARENT - During the running of the function outputNode(), the required $strParentNode variable was missing
  • RSS_READER_ERROR_OUTPUTNODE_NOCHILD - During the running of the function outputNode(), the require $objChildNodes variable was missing
  • RSS_READER_ERROR_NOFEED - A function was ran that required the use of an rss feed to have been read

Class Functions

  • readFile( $strFile ) - This starts to read a file and begins processing it
  • readNode() - This process the current nodes information and organises it properly for reading.
  • outputNode( $strParentName, $objChildNodes ) - Output information as an array with the following information
  • defineError( $strErrorName ) - Define an error that has occured
page_revision: 7, last_edited: 1257044332|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License