Skip to content

Instantly share code, notes, and snippets.

@fabianoalmeida
Created January 25, 2012 10:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabianoalmeida/1675767 to your computer and use it in GitHub Desktop.
Save fabianoalmeida/1675767 to your computer and use it in GitHub Desktop.
Update entries from Feedzirra
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