2012-09-01 62 views

回答

1

你需要這在你的控制器:

require 'rss' 
rss = RSS::Parser.parse(open('http://example.com/feed/posts').read, false) 

Parsing an RSS feed with Ruby

0

我建議你使用的寶石叫Feedzirra

require 'feedzirra' 

# fetching a single feed 
feed = Feedzirra::Feed.fetch_and_parse("http://www.knews.kg/ru/politics/rss/") 

# feed and entries accessors 
feed.title     # => "Политика » K-News: Новости страны" 
feed.description   # => "Политика страны" 

,而安裝(Ubuntu的12.04)我有問題,編譯,試試這個

命令和apt-get安裝libcurl4-GNUTLS-dev的