Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Extensible Ruby wrapper for Atom and RSS parsers
branch: master
Failed to load latest commit information.
lib Fix infinite recursion problem on Ruby 1.9.
.gitignore Adding gitignore
History.txt Remove Windows line endings
License.txt Remove Windows line endings
Manifest.txt Removing gemspec
README.txt Remove Windows line endings
RELEASE Remove Windows line endings
Rakefile Fixed build


== Feed Normalizer

An extensible Ruby wrapper for Atom and RSS parsers.

Feed normalizer wraps various RSS and Atom parsers, and returns a single unified
object graph, regardless of the underlying feed format.

== Download

* gem install feed-normalizer
* svn co

== Usage

    require 'feed-normalizer'
    require 'open-uri'

    feed = FeedNormalizer::FeedNormalizer.parse open('')

    feed.title # => "International Herald Tribune"
    feed.url # => ""
    feed.entries.first.url # => ""

    feed.class # => FeedNormalizer::Feed
    feed.parser # => "RSS::Parser"

Now read an Atom feed, and the same class is returned, and the same terminology applies:

    feed = FeedNormalizer::FeedNormalizer.parse open('')

    feed.title # => ""
    feed.url # => ""
    feed.entries.first.url # => ""

The feed representation stays the same, even though a different parser was used.

    feed.class # => FeedNormalizer::Feed
    feed.parser # => "SimpleRSS"

== Cleaning / Sanitizing

    feed.title # => "My Feed > Your Feed"
    feed.entries.first.content # => "<p x='y'>Hello</p><object></object></html>"

All elements should now be either clean HTML, or HTML escaped strings.

    feed.title # => "My Feed &gt; Your Feed"
    feed.entries.first.content # => "<p>Hello</p>"

== Extending

Implement a parser wrapper by extending the FeedNormalizer::Parser class and overriding
the public methods. Also note the helper methods in the root Parser object to make
mapping of output from the particular parser to the Feed object easier.

See FeedNormalizer::RubyRssParser and FeedNormalizer::SimpleRssParser for examples.

== Authors
* Andrew A. Smith (

This library is released under the terms of the BSD License (see the License.txt file for details).
Something went wrong with that request. Please try again.