开发者

Why doesn't Ruby RSS retrieve the entire feed from Wordpress RSS?

I wrote a quick bit in Ruby to consume an RSS feed from Wordpress. A dumbed down version looks like this:

require 'rss'
@rss = RSS::Parser.parse(open('http://blog.allbouttexas.com/feed/').read, false).items[0..3]
@rss.each do |rss|
  puts rss.dc_creator
end

This works great, then, when I deployed to my production server and executed it, I got:

undefined method 'dc_creator'

I am a little boggled by this and did some debugging. It appears that when the RSS feed is retrieved on the production server, not ALL开发者_StackOverflow社区 elements are included in the @rss object. Another element not included is content_encoded.

I then changed my local copy by modifying the include to this:

require 'rss/2.0.

After doing this, I get the same error as on production. Appears that my versions of RSS are different.

Also, after research, it appears that the RSS libraries do not have access to Dublin Core elements. Trying to figure out how to access these elements via RSS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜