Saturday, May 19, 2007

Reading RSS feeds with Java

If you were interested in incorporating RSS feeds into your java code you might want to have a look at Project Rome which is an open source java library for handling RSS feeds. Rome is currently in version 0.9 can be found at

I wrote a simple sample program which reads a given RSS feed and display some of the feed entries along with some attributes. It will also display the RSS version, as there are different versions of RSS.

This simple program is the following:

import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndImageImpl;
import java.util.List;
import com.sun.syndication.feed.synd.SyndContentImpl;

* 2 Required Jar files
* rome-0.9.jar retrieved from
* jdom.jar retrieved from

public class RSSReader

public static void iterateRSSFeed(String rssFeedUrl)
//open up a connection to the rss feed

URLConnection feedUrl = new URL(rssFeedUrl).openConnection();

//Create Feed Object
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = XmlReader(feedUrl));

System.out.println("Examining rss feed:"+rssFeedUrl+"\n");

System.out.println("Feed type="+feed.getFeedType());

//Iterate through object to get details
List list = feed.getEntries();

System.out.println("Feed image="+feed.getImage());
if (feed.getImage()!=null)
SyndImageImpl image = (SyndImageImpl)feed.getImage();
String imageInfo = "Image url:"+image.getUrl()+"\n";
for (int i=0 ; i < list.size(); i++){

//display entry attributes
SyndEntry entry = (SyndEntry)list.get(i);
String display = "Entry:"+i;
display += "\ntitle:"+entry.getTitle();
display += "\nlink:"+entry.getLink();
display += "\nauthor:"+entry.getAuthor();
display += "\npublished:"+entry.getPublishedDate();
display += "\nupdated:"+entry.getUpdatedDate();
display += "\ndescription:"+entry.getDescription();

display += "\ncontent size:"+entry.getContents().size();
if (entry.getContents().size()==1)
SyndContentImpl imp = (SyndContentImpl)entry.getContents().get(0);
display += "\ncontent value:"+imp.getValue();
display += "\n";


catch(Exception e)


public static void main(String[] args) {

//James Gosling's blog
String rssFeedUrl = "";

//Mark Cuban's blog
//rssFeedUrl = "";

//rssFeedUrl = "";

//RSS 2.0
//rssFeedUrl = "";



Wednesday, May 2, 2007

Developing Knowledge-Based Client Relationships

I just finished Ross Dawson's "Developing Knowledge-Based Client Relationships". I found it useful in understanding more of the business side of consulting and client relationships.

The book provides a couple of interesting definitions. "Information is anything that can be digitized, while knowledge is the capacity to act effectively, an attribute unique to people."p.96

Strategy in these types of client relationships is to evolve where the vendor and client integrate/collaborate at a high level to create higher levels of value creation.

A vendor should strive to avoid black box/commodity work and strive for the higher level knowledge based/collaborative solutions.

This was a good book for illuminating how to deal with clients strategically. Similar to "The Trusted Advisor". This was a good read before I dive back into more technical reads. :-)