The Encog Project

org.encog.bot.rss
Class RSS

java.lang.Object
  extended by org.encog.bot.rss.RSS

public class RSS
extends java.lang.Object

RSS: This is the class that actually parses the RSS and builds a collection of RSSItems. To make use of this class call the load method with a URL that points to RSS.


Constructor Summary
RSS()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Get the list of attributes.
 java.util.List<RSSItem> getItems()
           
static java.lang.String getXMLText(org.w3c.dom.Node n)
          Simple utility method that obtains the text of an XML node.
 void load(java.net.URL url)
          Load all RSS data from the specified URL.
static java.util.Date parseDate(java.lang.String datestr)
          Simple utility function that converts a RSS formatted date into a Java date.
 java.lang.String toString()
          Convert the object to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RSS

public RSS()
Method Detail

getXMLText

public static java.lang.String getXMLText(org.w3c.dom.Node n)
Simple utility method that obtains the text of an XML node.

Parameters:
n - The XML node.
Returns:
The text of the specified XML node.

parseDate

public static java.util.Date parseDate(java.lang.String datestr)
Simple utility function that converts a RSS formatted date into a Java date.

Parameters:
datestr - The RSS formatted date.
Returns:
A Java java.util.date

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Get the list of attributes.

Returns:
the attributes

getItems

public java.util.List<RSSItem> getItems()
Returns:
the items

load

public void load(java.net.URL url)
          throws java.io.IOException,
                 org.xml.sax.SAXException,
                 javax.xml.parsers.ParserConfigurationException
Load all RSS data from the specified URL.

Parameters:
url - URL that contains XML data.
Throws:
java.io.IOException - Thrown if an IO error occurs.
org.xml.sax.SAXException - Thrown if there is an error while parsing XML.
javax.xml.parsers.ParserConfigurationException - Thrown if there is an XML parse config error.

toString

public java.lang.String toString()
Convert the object to a String.

Overrides:
toString in class java.lang.Object
Returns:
The object as a String.

The Encog Project