Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 rss ruby 模块来解析 rssFeed。
File.open(filename,'r') do |rss| feed = RSS::Parser.parse(rss) feed.items.each do |item| puts category end end
是否有更多类别只会显示 rssfeed 项中的第一个类别。如何显示所有类别?
你应该能够做到
item.categories.each do |cat| #do something here end
如果您的项目有类别,那么它应该是
... puts item.category ...