Created
January 25, 2012 10:32
-
-
Save fabianoalmeida/1675767 to your computer and use it in GitHub Desktop.
Update entries from Feedzirra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'activesupport' | |
require 'feedzirra' | |
feed = Feedzirra::Parser::RSS.new | |
feed.feed_url = "http://feeds.feedburner.com/gizmodobr?format=xml" # URL from my database | |
feed.last_modified = Time.utc(2012, 1, 1) # Feed from my database | |
entry = Feedzirra::Parser::RSSEntry.new | |
entry.url = "http://feedproxy.google.com/~r/gizmodobr/~3/5YLB2D-K49w/story01.htm" # Last entry URL on my database | |
feed.entries << entry | |
updated_feed = Feedzirra::Feed.update(feed) | |
puts updated_feed.new_entries | |
puts updated_feed.new_entries.count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment