[ANN] RSS Parser 0.1.7

Discussion in 'Ruby' started by Kouhei Sutou, Mar 17, 2007.

  1. Kouhei Sutou

    Kouhei Sutou Guest

    Hi,

    I released RSS Parser 0.1.7:
    http://raa.ruby-lang.org/project/rss/

    Here are new features:

    * Atom support
    * (official) DublinCore module with RSS 2.0 support
    * New convenience methods to convert feed type: to_xml,
    to_feed, to_rss, to_atom and to_xml.

    Here are changes:

    * dc_rightses -> dc_rights_list: Thanks to Mathieu Bouchard!
    * Stop ruby 1.6.x support


    = Details

    == Atom support

    Atom support means the followings:

    * RSS::parser.parse can parse Atom feed document with
    validation.
    * RSS::parser.parse can parse Atom entry document with
    validation.
    * RSS::Maker.make can make Atom feed document.
    * RSS::Maker.make can make Atom entry document.

    To support Atom, I changed the following reading APIs of RSS
    Maker:

    * maker.channel.title
    * maker.channel.description
    * maker.channel.copyright
    * item.title
    * item.link
    * item.description
    * item.rights

    They return a String or nil since 0.1.6. But They always
    return an object.

    I think this change doesn't have big impact because most of
    users don't use them. They always use only writer APIs.

    == DublinCore module with RSS 2.0 support

    RSS Parser parses DublinCore module in RSS 2.0 now
    officially. We need to require some files. We can just write
    the following:

    require 'rss'
    feed = RSS::parser.parse(...)

    == Feed conversion

    We can convert RSS 1.0 to RSS 2.0 by the following code:

    rss20 = rss10.to_rss("2.0")

    We can convert RSS 1.0 to Atom feed document by the
    following code:

    feed = rss10.to_atom("feed")

    But you may need to set some values required by returned
    feed type but not required by converted feed. For example,
    /rss/item/title isn't required value in RSS 2.0 but
    /rdf:RDF/item/title is required value in RSS 1.0. In the
    situation, we can set default value like the following:

    rss10 = rss20.to_rss("1.0") do |maker|
    maker.items.each do |item|
    item.title.content ||= "Default Title"
    end
    end




    Thanks,
    --
    kou
     
    Kouhei Sutou, Mar 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    776
    SpaceGirl
    Feb 25, 2005
  2. Kouhei Sutou

    [ANN] RSS Parser 0.1.0

    Kouhei Sutou, Nov 3, 2004, in forum: Ruby
    Replies:
    0
    Views:
    90
    Kouhei Sutou
    Nov 3, 2004
  3. Kouhei Sutou

    [ANN] RSS Parser 0.1.1

    Kouhei Sutou, Nov 28, 2004, in forum: Ruby
    Replies:
    0
    Views:
    83
    Kouhei Sutou
    Nov 28, 2004
  4. Lucas Nussbaum
    Replies:
    0
    Views:
    144
    Lucas Nussbaum
    Nov 15, 2005
  5. Jonathan Groll
    Replies:
    1
    Views:
    281
    Kouhei Sutou
    Jun 27, 2009
Loading...

Share This Page