什么是解析 RSS/ATOM 提要并在 Rails 视图中呈现内容的好解决方案?
问问题
949 次
3 回答
4
我在http://www.robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed(以及其中的链接)上看到了关于解析部分的好注释。一旦你解析了它们,如何最好地呈现它们可能是一个主观问题......
于 2009-05-27T23:45:46.163 回答
3
最近的Railscast 之一(2009 年 6 月 29 日)推荐了 Feedzirra
于 2009-07-11T19:44:31.543 回答
0
id 推荐acts_as_feed,它负责自动解析,充当 feed rails 插件,可以添加到模型中。只要您只需要显示提要,另一种解决方案就是使用google feed api 。
#HAML view example
- if feed.filled?
%h2="Blog: #{feed.title}"
- for item in feed.entries[0...5]
-date = item.published_at.to_date.to_s(:long)
%h2=link_to(h(item.title),h(item.url))
于 2009-05-28T18:59:37.710 回答