簡體   English   中英

Rails庫來處理RSS / ATOM提要?

[英]Rails library to process an RSS/ATOM feed?

解析RSS / ATOM提要並在Rails視圖中顯示內容的最佳解決方案是什么?

我在http://www.robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed (及其鏈接)上的解析部分中看到了不錯的注釋。 解析事物后如何最好地呈現事物可能是一個主觀問題...

id建議act_as_feed,它負責自動解析,可以充當feed rail插件,並且可以添加到模型中。 另一個解決方案是,只要您只需要顯示供稿,就可以使用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))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM