I’m trying to use the SyndicationFeed class to get content from a feed, but for some feeds it works ok but for others it doesn’t.
For example, when I want to get feeds from http://www.alistapart.com/site/rss , the LastUpdatedTime has a value of 01-01-0001 for all feed items and the feed itself.
Is there something that i need to do? or is it maybe that SyndicationFeed doesn’t support all websites to read from them all the information?
some sample code that i’m using :
var feed = SyndicationFeed.Load(XmlReader.Create("http://www.alistapart.com/site/rss"));
var feedPosts = feed.Items; // here all feedPosts have the invalid LastUpdatedTime, but if i go to the website i can see that there is actually one
You are looking at the
LastUpdatedTimewhile the date in the RSS you mentioned is notLastUpdatedTimenor the more common datepubDate. Note the namespace which is"http://purl.org/dc/elements/1.1/".Most of these elements are optional and you must be able to live without them or use alternative ones.
I have create a Podcast software and I have found the
SyndicationFeedimplementation very poor and brittle to deal with various dates which are there in the real world.UPDATE
Yes, have a look at Element Extensions.