Skip to content

A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.

License

Notifications You must be signed in to change notification settings

aldavidson/simple-rss

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

== Welcome to Simple RSS
Simple RSS is a simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.

== Fork
This fork removes all usage of the pre-defined variables $1,$2, et cetera and replaces them with RegExp objects. Removed the tabs and indents and replaced with spaces. I also refactored if/else clauses without body.

== Download
get the original gem
* gem install simple-rss
* http://rubyforge.org/projects/simple-rss
* svn co http://rufy.com/svn/simple-rss/trunk

clone the forked source
* git clone git://github.com/aqab/simple-rss.git

then Install the forked gem
* gem install aqab-simple-rss-1.2.4.gem

=== Usage
The API is similar to Ruby's standard RSS parser:

    require 'rubygems'
    require 'simple-rss'
    require 'open-uri'

    rss = SimpleRSS.parse open('http://slashdot.org/index.rdf')

    rss.channel.title # => "Slashdot"
    rss.channel.link # => "http://slashdot.org/"
    rss.items.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"

But since the parser can read Atom feeds as easily as RSS feeds, there are optional aliases that allow more atom like reading:

    rss.feed.title # => "Slashdot"
    rss.feed.link # => "http://slashdot.org/"
    rss.entries.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"

The parser does not care about the correctness of the XML as it does not use an XML library to read the information. Thus it is flexible and allows for easy extending via:

   SimpleRSS.feed_tags << :some_new_tag
   SimpleRSS.item_tags << :"item+myrel" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a rel specified, common in many blogger feeds
   SimpleRSS.item_tags << :"feedburner:origLink" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a specific pre-tag specified, common in many feedburner feeds


== Authors
* Lucas Carlson  (mailto:[email protected])
* Blogpost fix by Al Davidson ([email protected])
* Refactoring by Aqab Bin Talal ([email protected])

Inspired by Blagg (http://www.raelity.org/lang/perl/blagg) from Rael Dornfest.

This library is released under the terms of the GNU LGPL.

About

A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%