<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>File: feedparser.rb</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="fileHeader"> <h1>feedparser.rb</h1> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Path:</strong></td> <td>lib/feedparser.rb </td> </tr> <tr class="top-aligned-row"> <td><strong>Last Update:</strong></td> <td>Mon Jun 16 05:31:44 -0400 2008</td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="diagram"> <map id="map" name="map"> </map> <img src="../../dot/f_0.png" usemap="#map" border="0" alt="dot/f_0.png"> </div> <div id="description"> <h1>Ruby-feedparser - ATOM/RSS feed parser for Ruby</h1> <table> <tr><td valign="top">License:</td><td>Ruby‘s license (see the LICENSE file) or GNU GPL, at your option. </td></tr> </table> <p> Website::http://home.gna.org/ruby-feedparser/ </p> <h2>Introduction</h2> <p> Ruby-Feedparser is an RSS and Atom parser for Ruby. Ruby-feedparser is : </p> <ul> <li>based on <a href="../../classes/REXML.html">REXML</a> </li> <li>built for robustness : most feeds are not valid, a parser can‘t ignore that </li> <li>fully unit-tested </li> <li>easy to use (it can output text or HTML easily) </li> </ul> <h2>Example</h2> <pre> require 'net/http' require 'feedparser' require 'uri' s = Net::HTTP::get URI::parse('http://rss.slashdot.org/Slashdot/slashdot') f = FeedParser::Feed::new(s) f.title => "Slashdot" f.items.each { |i| puts i.title } [...] require 'feedparser/html-output' f.items.each { |i| puts i.to_html } </pre> </div> <div id="requires-list"> <h3 class="section-bar">Required files</h3> <div class="name-list"> feedparser/feedparser </div> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>