I've been thinking more about using Del.icio.us to tag my comments and display them on my blog by parsing out a http://del.icio.us/rss/daveburkevt/comments RSS feed. All of the pieces were in place ready for .NET project initiation when it hit me that I have never written code that consumes an RSS feed. It seems ridiculous, I know, but in all of my hours logged with Community Server and dotText, I never wrote a line of code that spits out syndicated content. It was time to research the market, which is when I locked-in on the SKM Brand.
There are a select few developers who are on that PREEMO top-shelf. One of those developers is Scott Mitchell. His grasp and productivity in the .NET arena drawfs most of the nerd pack. He has also made valuable contributions to the .NET community with his SKM packages. I used his SKMMenu for a while and picked up some great tips. Recently Scott introduced RSSFeed, or the SKMRSS project. Who better to lead me in my quest to consume RSS than SKM? Nobody, baby.
RSSFeed is a bindable ASP.NET control that gives you the ability to display syndicated content with as few as two lines of code. Here is the 4GuysFromRolla article.
RssFeedID.DataSource = http://dbvt.com/blog/rss.aspx
RssFeedID.DataBind()
But Mr. Mitchell doesn't stop there in his RSS source contibutions. He also wrote a SyndicationDemo package for MSDN. Its old, but its gold, demonstrating both how to create an RSS feed as well as how to consume it. I compiled both the SKMRSS and SyndicationDemo projects and started poking around.
For the SKMRSS web control I added an OnItemDataBound to add a <BASE href=pageURL> to support full paths to images.
protected void RssFeed_OnItemDataBound(object sender, RssFeedItemEventArgs e)
{
if (e.Item.ItemType == RssFeedItemType.Item || e.Item.ItemType == RssFeedItemType.AlternatingItem)
{
Label lblHeaderInfo = (Label)e.Item.FindControl("lblHeaderInfo");
lblHeaderInfo.Text = "<base href=\"" + e.Item.DataItem.Link + "\">";
string body = e.Item.DataItem.Description;
}
}
Here are screenshots of SKMRSS displaying both my blog's RSS Feed and Del.icio.us feed. Click to display larger images.
Here is a screenshot of Scott's SyndicationDemo app displaying my blog feed. It demonstrates generating a feed as well as consuming it. While the SKMRSS project is a bindable web control, the Syndication Demo uses .XSLT Transform to display the feed contents.
XsltArgumentList xsltArgList = new XsltArgumentList();
xsltArgList.AddParam("ID", "", ID);
xmlItem.TransformArgumentList = xsltArgList;
Several great latenight geek hours spent with the SKM brand working with RSS Feeds. Posts on the particulars will follow. Here I wanted to make sure everyone interested in working with RSS Feeds was introduced to the SKM brand.
Technorati Tags: ASP.NET, RSS, Delicious, Code