【发布时间】:2012-11-04 21:04:14
【问题描述】:
我正在尝试使用 SyndicationFeed 类从提要中获取内容,但对于某些提要它可以正常工作,但对于其他提要则不行。
例如,当我想从 http://www.alistapart.com/site/rss 获取提要时,所有提要项和提要本身的 LastUpdatedTime 值为 01-01-0001。
有什么我需要做的吗?还是 SyndicationFeed 不支持所有网站都可以读取所有信息?
我正在使用的一些示例代码:
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
【问题讨论】:
-
您是从 RSS 提要还是从 Atom 拉取?字段名称是否相同?尝试手动解析提要中的日期/时间,看看你得到了什么。
-
我不应该解析任何东西,这个类的想法是它为你完成了这项工作......我当然可以解析它,但我不想为它创建一个自定义解析器每种类型的饲料