Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RSS feeds and API for it

807569Jun 28 2006 — edited Jul 4 2006
I am trying to implement rss feeds in a java program and will later move it into JSP.
I checked out the code on a sun site:
try {      
  URL feed = new URL("file:/C:/samplefeed.rss");
  ChannelFormat format = FormatDetector.getFormat(feed);
  ChannelParserCollection parsers = 
                          ChannelParserCollection.getInstance();
                       
  ChannelParserIF parser = 
    parsers.getParser(format, feed);
	
  parser.setBuilder(new ChannelBuilder());
  ChannelIF channel = parser.parse();
  
  for (Iterator iter = channel.getItems().iterator(); 
                                     iter.hasNext();) {
    ItemIF item = (ItemIF)iter.next();
    System.out.println(item.getTitle());
  }
} catch (MalformedURLException mue) {
  mue.printStackTrace();
} catch (UnsupportedFormatException ufe) {
  ufe.printStackTrace();
} catch (ParseException pe) {
  pe.printStackTrace();
}
to get the data from the rss feed website.

My first question is can I get a rss feed from a site say of CNN using
URL feed = new URL("http://rss.cnn.com/rss/edition_asia.rss")
just like:
URL feed = new URL("file:/C:/samplefeed.rss");
and still continue with the rest of the program.

My second question is:
I found informa-bin-0.6.5.tar.gz and informa-src-0.6.5.tar.gz in the informa library.
Im working on Windows 2000. How do I proceed with these files. To use them I need them in jar format right?
I already have downloaded the informa.jar file from somewhere on the net and I can use its classes successfully.
But I get

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Category
at Feeds.main(Feeds.java:45)

when i run the program.

Message was edited by:
PremM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2006
Added on Jun 28 2006
7 comments
365 views