I'm trying to pull the contents of an RSS feed into an object that can be manipulated in code. It looks like the SyndicationFeed and SyndicationItem classes in .NET 3.5 will do what I need, except for one thing. Every time I've tried to read in the contents of an RSS feed using the SyndicationFeed class, the .Content element for each SyndicationItem is null.
I've run my feed through FeedValidator and have tried this with feeds from several other sources, but to no avail.
XmlReader xr = XmlReader.Create("http://shortordercode.com/feed/");
SyndicationFeed feed = SyndicationFeed.Load(xr);
foreach (SyndicationItem item in feed.Items)
{
Console.WriteLine(item.Title.Text);
Console.WriteLine(item.Content.ToString());
}
Console.ReadLine();
I suspect I may just be missing a step somewhere, but I can't seem to find a good tutorial on how to consume RSS feeds using these classes.
EDIT: Thanks to SLaks I've figured out that the issue is with WordPress's use of as the content tag. This doesn't appear to be a problem with the WP Atom feeds so I'll go with that as a solution for now. Thanks SLaks!