Easy Does It
Well, the commercials are everywhere (my favorite is the guy that gets stuck in front of the great wall) and well who can’t resist it? I am referring to the Staples® Easy button. I have placed one of these on my desk and hit it every so often and it really does work…..
I am surprised nothing like this made its way to thinkgeek.com.
Syndicate Me
RSS has quickly picked up as an effective way of monitoring updated content on web sites (I even have one for this site). There are many applications available to aggregate these feeds. RSS is common enough that RSS aggregation is available (or soon to be) in popular web browsers. What if you wanted your own application or web site to include RSS feed information?
Aggregating and parsing RSS feed information via System.XML namespace of .NET is a lot easier than it sounds. Fortunately RSS is a standard structure XML file. The sub-elements of each item element contain the update information. I have created three (extremely basic) separate examples (BDS 2006, VB.NET 2005 and ASP.NET) of including feed information in your application. (I also put some together using the MSXML ActiveX library that I’ll probably put in another post)
Setting the sample (WinForm) application up in BDS 2006 (Delphi®) and VB.NET 2005 is pretty much the same. On a form I place a Button, TextBox and RichTextBox (screenshot is the two side-by-side).

The TextBox is where one enters the URL of a RSS feed. When the button is clicked the RichTextBox is filled with the feed sub-element information. They both need to use the System.XML namespace.
VB.NET Code
Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim XMLDoc As New System.Xml.XmlDocument
Dim rssItems As System.Xml.XmlNodeList
Dim child, cn As System.Xml.XmlNode
RichTextBox1.Clear()
XMLDoc.Load(TextBox1.Text)
' each of the sub-elements of the item element contain the feed information
rssItems = XMLDoc.GetElementsByTagName("item")
For Each child In rssItems
For Each cn In child.ChildNodes
' you could filter and/or process each element by name - depending
' on what you'd like to do with node data (i.e. hyperlink to the
' actual post)
RichTextBox1.AppendText(cn.Name)
RichTextBox1.AppendText(vbCr)
RichTextBox1.AppendText(cn.InnerText.Trim)
RichTextBox1.AppendText(vbCrLf)
Next
Next
End Sub
Delphi® Code procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
var
XMLDoc: System.Xml.XmlDocument;
rssItems: System.Xml.XmlNodeList;
child, cn: System.Xml.XmlNode;
begin
RichTextBox1.Clear;
XMLDoc:= XmlDocument.Create;
XMLDoc.Load(TextBox1.Text);
rssItems:= XMLDoc.GetElementsByTagName('item');
For child in rssItems do
begin
For cn in child.ChildNodes do
begin
RichTextBox1.AppendText(cn.Name);
RichTextBox1.AppendText(#13);
RichTextBox1.AppendText(cn.InnerText.Trim);
RichTextBox1.AppendText(#13#10);
end;
end;
end;
To display the same information on an ASP.NET web page create a document with the following code:
<html>
<head>
<title>BPSoftware.com - RSS Reader</title>
</head>
<body bgcolor="#f8f8ff">
<%
Dim XMLDoc As New System.Xml.XmlDocument
Dim rssItems As System.Xml.XmlNodeList
Dim child, cn As System.Xml.XmlNode
XMLDoc.Load("http://www.techweb.com/rss/all.xml ")
rssItems = XMLDoc.GetElementsByTagName("item")
For Each child In rssItems
For Each cn In child.ChildNodes %>
<br />
<br />
<%
Next
Next
%>
</body>
</html>
After you get the basic connectivity and processing working, it is easy to filter our and process only the sub-elements that you’d like to include in your application or on your web page. There is a lot that can be done with this inside of an application; I figured I’d go with the basics to help spark some interest. For some unknown reason I've abandoned C some time ago, but if anyone wants to follow up with the same in C please do....