Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aasmith/feed-normalizer
Extensible Ruby wrapper for Atom and RSS parsers
https://github.com/aasmith/feed-normalizer
Last synced: 3 months ago
JSON representation
Extensible Ruby wrapper for Atom and RSS parsers
- Host: GitHub
- URL: https://github.com/aasmith/feed-normalizer
- Owner: aasmith
- License: bsd-3-clause
- Created: 2008-06-04T17:24:59.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2014-03-29T02:36:43.000Z (almost 11 years ago)
- Last Synced: 2024-10-12T05:24:36.713Z (4 months ago)
- Language: Ruby
- Homepage: http://feed-normalizer.rubyforge.org/
- Size: 254 KB
- Stars: 134
- Watchers: 9
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.txt
- Changelog: History.txt
- License: License.txt
Awesome Lists containing this project
- awesome-ruby - Feed normalizer - Extensible Ruby wrapper for Atom and RSS parsers. (RSS)
README
== 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
* http://rubyforge.org/projects/feed-normalizer
* svn co http://feed-normalizer.googlecode.com/svn/trunk== Usage
require 'feed-normalizer'
require 'open-uri'feed = FeedNormalizer::FeedNormalizer.parse open('http://www.iht.com/rss/frontpage.xml')
feed.title # => "International Herald Tribune"
feed.url # => "http://www.iht.com/pages/index.php"
feed.entries.first.url # => "http://www.iht.com/articles/2006/10/03/frontpage/web.1003UN.php"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('http://www.atomenabled.org/atom.xml')
feed.title # => "AtomEnabled.org"
feed.url # => "http://www.atomenabled.org/atom.xml"
feed.entries.first.url # => "http://www.atomenabled.org/2006/09/moving-toward-atom.php"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 # => "Hello