Daniel Perez
Daniel Perez

Reputation: 4332

SyndicationFeed & SyndicationItem LastUpdatedTime

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

Upvotes: 0

Views: 1516

Answers (1)

Aliostad
Aliostad

Reputation: 81660

You are looking at the LastUpdatedTime while the date in the RSS you mentioned is not LastUpdatedTime nor the more common date pubDate. 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 SyndicationFeed implementation very poor and brittle to deal with various dates which are there in the real world.

UPDATE

is there a way to use the framework's classes to parse this non standard attributes?

Yes, have a look at Element Extensions.

Upvotes: 1

Related Questions