RSS 和 Atom 框架及扩展
我们有许多不错的 RSS 和 Atom 框架。我个人喜欢 CodePlex 的 Argotic 框架。
但问题在于扩展的多样性(请参阅 http://rss-extensions.org/wiki/Main_Page< /a>)。 第一个提要可以在没有扩展的情况下创建,第二个提要仅使用 iTunes,第三个提要使用 iTunes、媒体等。有时,一个项目可以同时包含简短的描述和完整的故事。
我想将这个 Zoo 减少到单个
标签而不丢失数据(例如,通过将来自 Youtube feed 的媒体扩展的描述和内容放在一起)
Argotic 框架有 GenericFeed
,但它对我来说毫无用处,因为它根本忽略了扩展。
该系统的工作原理如下:服务器应用程序加载提要的内容并将其转换为通用形式并保存在数据库中。然后,为了响应来自客户端的请求,ASP.NET 网站从数据库加载此通用内容并以 JSON 格式发送到客户端。
在服务器端概括或提炼此类提要(具有许多不同的扩展)的最佳方法是什么,以便我可以将 JSON 格式的简单对象发送到客户端 JavaScript {title: "title", description: "描述”..}
?
We have many nice RSS and Atom frameworks. Personally I like Argotic Framework from CodePlex.
But the problem is in diversity of extensions (see http://rss-extensions.org/wiki/Main_Page).
First feed may be created without extensions, second with only iTunes, and third with iTunes, media and so on. Sometimes an item can consist of short description and full story at the same time.
I want to reduce this Zoo just to single <description>
tag without data loss (e.g. by putting together description and content of media extension from Youtube feed)
Argotic framework has GenericFeed
, but it useless for me because it just ignores extensions at all.
The system works as follows: a server application loads the contents of the feed and transforms it to the general form and saves in a database. Then, in response to a request from a client ASP.NET web site loads this generalized content from database and sends to the client in JSON format.
What is the best way to generalize or distill such a kind of feeds (with many different extensions) on server side so that I can send to client javascripts just simple object in JSON format {title: "title", description: "description" ..}
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Argotic 之上编写了自己的层(一个项目类、一个提要类以及一个用于合并提要的漏斗类),以处理提要格式“标准”中的扩展和其他异常。出版物尤其糟糕。
首先我得到通用提要。然后,根据提要类型和来源,我处理提要格式的特定参数对象(Rssfeed Atomfeed),最后,如果有必要,我从 xml 源本身提取数据。
如果您知道自己的来源,那么这就是正确的方法,因为您可以获得您所期望的内容。
我希望这能让你感动。
I wrote my own layer (one item-class one feed class and also a funnel-class for merged feeds) on top of Argotic to handle extensions and other exceptions from the feed format "standards". Pubdates are particularly bad.
First i get the genereic feed. Then, based on feed type and origin i process the feed-formad specifiv argotic objects (Rssfeed Atomfeed), and finally, if necessary, i extract data from the xml source itself.
If you know your sources, this is the way to go since you can get what you expect.
I hope this will get you moving.