Skip to content

Instantly share code, notes, and snippets.

@pauldix
Created March 19, 2009 15:26
Show Gist options
  • Select an option

  • Save pauldix/81870 to your computer and use it in GitHub Desktop.

Select an option

Save pauldix/81870 to your computer and use it in GitHub Desktop.
# access an http basic feed. You can't do this in a bulk feed get. It has to be when getting only one.
Feedzirra::Feed.fetch_and_parse(some_url, :http_authentication => ["username", "password"])
# You can add custom parsing to the feed entry classes. Say you want the wfw:comments fields in an entry
Feedzirra::Feed.add_common_feed_entry_element("wfw:commentRss", :as => :comment_rss)
# The arguments are the same as the SAXMachine arguments for the element method. For more example usage look at the RSSEntry and
# AtomEntry classes. Now you can access those in an atom feed:
Feedzirra::Feed.parse(some_atom_xml).entries.first.comment_rss_ # => wfw:commentRss is now parsed!
# and the new accessors for feed entries
entry.id # => the atom id or rss guid
entry.modified # => the modified time of the post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment