The Artima Developer Community
Sponsored Link

Java Buzz Forum
OPML to HMTL using Informa

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Vinny Carpenter

Posts: 276
Nickname: vscarpente
Registered: Feb, 2003

Vinny is a Java developer/architect working with Java, J2EE, OO, Linux, OpenSource.
OPML to HMTL using Informa Posted: May 30, 2004 9:41 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Vinny Carpenter.
Original Post: OPML to HMTL using Informa
Feed Title: Vinny Carpenter's Blog
Feed URL: http://www.j2eegeek.com/error.html
Feed Description: Welcome to my blog. I am a total Java geek that lives in Milwaukee, making my living as an architect/developer, spending all my time with Java, J2EE, OO, Linux, and open source. In my spare time, when I am not in front of my computers, I spend every other minute with my other loves: My wife, books, music, guitars, Formula-1 racing and StarGate. Check out my blog @ http://www.j2eegeek.com/blog
Latest Java Buzz Posts
Latest Java Buzz Posts by Vinny Carpenter
Latest Posts From Vinny Carpenter's Blog

Advertisement

I've been having a few email discussions with a few of the blog readers about how I manage my blogroll and I decided to blog about it. Before I went out and purchased a copy of FeedDemon, a great RSS/ATOM feed reader, I had written my own crude feed reader. My feed reader used Informa for feed consumption and parsing and used a local MySQL database to keep track of my feeds subscription. Upon startup, the simple web application would load a list of my subscribed feeds from the database, parse them using Informa and save them locally. Worked well enough and let me learn more about Informa, which is really a very good RSS library for Java.

Now that I use FeedDemon, I output the blogs I read as an OPML file and then use Informa to create my HTML blogroll. Here's a little code snippet on how I use Informa's OPML support to parse my OPML file and iterate through the file to create the HTML that's included in my blog. I also stole Don Park's imageless RSS feed icon CSS to format my blogroll. Thanks Don - Great idea.

StringBuffer sb = new StringBuffer(); 
try {
Collection feeds = OPMLParser.parse(
"file:///C:/projects/opml2html/data/blogs.opml");
sb.append(
"<ul class=\"navlist\">");

Iterator it = feeds.iterator();
while (it.hasNext()) {
FeedIF feed = (FeedIF) it.next();
sb.append(
"<li><a href=\"");
sb.append(feed.getSite().toExternalForm());
sb.append(
"\">");
sb.append(feed.getTitle());
sb.append(
"</a> <a href=\"");
sb.append(feed.getLocation().toExternalForm());
sb.append(
"\" class=\"feedIconStyle\">XML</A>\n");
}
}
catch (IOException e) {

Informa is a great collaboration by the authors of HotSheet and Risotto, two independent Java/RSS efforts out in the market. If you have a need to parse RSS and display via. JSP's, you need to check out the RSS JSP tag library and RSS-desk projects that are based on Informa.

Read: OPML to HMTL using Informa

Topic: No wonder Jini doesn't get used Previous Topic   Next Topic Topic: ObjectFilter and the Canadian Army and DARPA and Bears (oh my!)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use