U:RDoc::NormalModule[iI"RSS:EF@0o:RDoc::Markup::Document: @parts[/o;;[!S:RDoc::Markup::Heading: leveli: textI"RSS reading and writing;To:RDoc::Markup::BlankLineo:RDoc::Markup::Paragraph;[ I"SReally Simple Syndication (RSS) is a family of formats that describe 'feeds,' ;TI"Lspecially constructed XML documents that allow an interested person to ;TI"Rsubscribe and receive updates from a particular web service. This portion of ;TI"Jthe standard library provides tooling to read and create these feeds.;T@o; ;[I"SThe standard library supports RSS 0.91, 1.0, 2.0, and Atom, a related format. ;TI"FHere are some links to the standards documents for these formats:;T@o:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0;[o; ;[I"RSS;To;;;;[o;;0;[o; ;[I"60.9.1[http://www.rssboard.org/rss-0-9-1-netscape];To;;0;[o; ;[I"*1.0[http://web.resource.org/rss/1.0/];To;;0;[o; ;[I"32.0[http://www.rssboard.org/rss-specification];To;;0;[o; ;[I"-Atom[http://tools.ietf.org/html/rfc4287];T@S; ; i; I"Consuming RSS;T@o; ;[I"RIf you'd like to read someone's RSS feed with your Ruby code, you've come to ;TI"Nthe right place. It's really easy to do this, but we'll need the help of ;TI"open-uri:;T@o:RDoc::Markup::Verbatim;[I"require 'rss' ;TI"require 'open-uri' ;TI" ;TI"8url = 'http://www.ruby-lang.org/en/feeds/news.rss' ;TI"open(url) do |rss| ;TI"% feed = RSS::Parser.parse(rss) ;TI"+ puts "Title: #{feed.channel.title}" ;TI"! feed.items.each do |item| ;TI"$ puts "Item: #{item.title}" ;TI" end ;TI" end ;T: @format0o; ;[ I"SAs you can see, the workhorse is RSS::Parser#parse, which takes the source of ;TI"Sthe feed and a parameter that performs validation on the feed. We get back an ;TI"Pobject that has all of the data from our feed, accessible through methods. ;TI"RThis example shows getting the title out of the channel element, and looping ;TI"through the list of items.;T@S; ; i; I"Producing RSS;T@o; ;[I"OProducing our own RSS feeds is easy as well. Let's make a very basic feed:;T@o;;[I"require "rss" ;TI" ;TI".rss = RSS::Maker.make("atom") do |maker| ;TI"% maker.channel.author = "matz" ;TI"- maker.channel.updated = Time.now.to_s ;TI"J maker.channel.about = "http://www.ruby-lang.org/en/feeds/news.rss" ;TI", maker.channel.title = "Example Feed" ;TI" ;TI"& maker.items.new_item do |item| ;TI"` item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/" ;TI"4 item.title = "Ruby 1.9.2-p136 is released" ;TI"& item.updated = Time.now.to_s ;TI" end ;TI" end ;TI" ;TI"puts rss ;T;0o; ;[I"QAs you can see, this is a very Builder-like DSL. This code will spit out an ;TI"RAtom feed with one item. If we needed a second item, we'd make another block ;TI"6with maker.items.new_item and build a second one.;T@S; ; i; I"Copyright;T@o; ;[I";T@o; ;[I"KYou can redistribute it and/or modify it under the same terms as Ruby.;T@o; ;[I">There is an additional tutorial by the author of RSS at: ;TI"Nhttp://www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.en;T: @fileI"lib/rss.rb;T:0@omit_headings_from_table_of_contents_below0o;;[;I"lib/rss/0.9.rb;T;0o;;[;I"lib/rss/1.0.rb;T;0o;;[;I"lib/rss/2.0.rb;T;0o;;[;I"lib/rss/atom.rb;T;0o;;[;I"lib/rss/content.rb;T;0o;;[;I"lib/rss/content/1.0.rb;T;0o;;[;I"lib/rss/content/2.0.rb;T;0o;;[;I"lib/rss/converter.rb;T;0o;;[;I"lib/rss/dublincore.rb;T;0o;;[;I"lib/rss/dublincore/1.0.rb;T;0o;;[;I"lib/rss/dublincore/2.0.rb;T;0o;;[;I"lib/rss/dublincore/atom.rb;T;0o;;[;I"lib/rss/image.rb;T;0o;;[;I"lib/rss/itunes.rb;T;0o;;[;I"lib/rss/maker.rb;T;0o;;[;I"lib/rss/maker/0.9.rb;T;0o;;[;I"lib/rss/maker/1.0.rb;T;0o;;[;I"lib/rss/maker/2.0.rb;T;0o;;[;I"lib/rss/maker/atom.rb;T;0o;;[;I"lib/rss/maker/base.rb;T;0o;;[;I"lib/rss/maker/content.rb;T;0o;;[;I" lib/rss/maker/dublincore.rb;T;0o;;[;I"lib/rss/maker/entry.rb;T;0o;;[;I"lib/rss/maker/feed.rb;T;0o;;[;I"lib/rss/maker/image.rb;T;0o;;[;I"lib/rss/maker/itunes.rb;T;0o;;[;I"lib/rss/maker/slash.rb;T;0o;;[;I"!lib/rss/maker/syndication.rb;T;0o;;[;I"lib/rss/maker/taxonomy.rb;T;0o;;[;I"lib/rss/maker/trackback.rb;T;0o;;[;I"lib/rss/parser.rb;T;0o;;[;I"lib/rss/rexmlparser.rb;T;0o;;[;I"lib/rss/rss.rb;T;0o;;[;I"lib/rss/slash.rb;T;0o;;[;I"lib/rss/syndication.rb;T;0o;;[;I"lib/rss/taxonomy.rb;T;0o;;[;I"lib/rss/utils.rb;T;0o;;[;I"lib/rss/xml-stylesheet.rb;T;0o;;[;I"lib/rss/xml.rb;T;0o;;[;I"lib/rss/xmlparser.rb;T;0o;;[;I"lib/rss/xmlscanner.rb;T;0;0;0[[U:RDoc::Constant[iI"CONTENT_PREFIX;FI"RSS::CONTENT_PREFIX;T00o;;[o; ;[I".The prefix for the Content XML namespace.;T;@;0@@cRDoc::NormalModule0U;[iI"CONTENT_URI;FI"RSS::CONTENT_URI;T00o;;[o; ;[I"*The URI of the Content specification.;T;@;0@@@0U;[iI"DC_PREFIX;FI"RSS::DC_PREFIX;T00o;;[o; ;[I"2The prefix for the Dublin Core XML namespace.;T;@;0@@@0U;[iI" DC_URI;FI"RSS::DC_URI;T00o;;[o; ;[I".The URI of the Dublin Core specification.;T;@;0@@@0U;[iI"DublincoreModel;FI"RSS::DublincoreModel;T0I"RSS::DublinCoreModel;To;;[o; ;[I"For backward compatibility;T;@;0@@@0U;[iI"IMAGE_PREFIX;FI"RSS::IMAGE_PREFIX;T00o;;[o; ;[I",The prefix for the Image XML namespace.;T;@;0@@@0U;[iI"IMAGE_URI;FI"RSS::IMAGE_URI;T00o;;[o; ;[I")The URI for the Image specification.;T;@;0@@@0U;[iI"IMAGE_ELEMENTS;FI"RSS::IMAGE_ELEMENTS;T00o;;[o; ;[I"