I am trying to use feedzirra to grab rss/atom feeds, but feedzirra doesn't seem to find updates. I start by grabbing new feed and dumping the returned structure to a file.
require 'rubygems'
require 'yaml'
require 'feedzirra'
feed = Feedzirra::Feed.fetch_and_parse("http://rss.slashdot.org/Slashdot/slashdot")
File.open('slashdot.yaml','w'){|f| f.puts feed.to_yaml}
Then I wait a while, so that there are update to the feed, and I try:
require 'rubygems'
require 'yaml'
require 'feedzirra'
feed = YAML.load_file('slashdot.yaml')
puts feed.entries.first.published
updated_feed = Feedzirra::Feed.update(feed)
puts updated_feed.new_entries.first.published
all_new = Feedzirra::Feed.fetch_and_parse("http://rss.slashdot.org/Slashdot/slashdot")
puts all_new.entries.first.published
This results in:
Thu Apr 04 15:28:00 UTC 2013 Thu Apr 04 15:28:00 UTC 2013 Thu Apr 04 21:50:00 UTC 2013
The third line confirms that there are newer posts available, but Feed.update doesn't see them.
What am I doing wrong?