An open question about the RSS stdlib

Back in November, I built my RSS utility FeedBlender on the RSS standard library as it stood in (I believe) 1.8.2 preview 3, and it worked fine. Now as I've come back to take a look at it, I suspect that a change since then has made FeedBlender break. (I can't verify this without getting my hands on Ruby 1.8.2 preview 3; if anybody can tell me where to get this I'd be much obliged.)

Anyway, this is sort of my fault since I'm using the RSS library to write RSS in a way that Kou had told me isn't supported: You're supposed to delegate to RSS objects, not inherit from them. Me, I like inheriting, so that's what I did, and I got bit ... there are some changes that somewhat mystify me, particularly the fact that it appears that RSS 2.0 objects now contain RSS::RDF::Item objects, instread of RSS::Rss::Channel::Item objects ...

I want to fix it, but I could use some counsel regarding the long-term plans of this library. Seems to me that the parsing is relatively stable, but the RSS generation is subject to change, right? The old-fashioned, REXML-style generation is obviously changing. The tutorial at http://www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.en mentions the RSS::Maker, which seems like a more Builder-style generation. But that tutorial also specifically says Maker's API isn't fixed either.

So if I want FeedBlender to use the standard RSS library, and I don't want to have to adapt to a new API every six months, what's my best bet?

Thanks,
Francis Hwang
http://fhwang.net/

Hi,

In <2596C3DE-6455-11D9-9CF4-000A95DBF456@fhwang.net>
  "An open question about the RSS stdlib" on Wed, 12 Jan 2005 13:42:03 +0900,

Back in November, I built my RSS utility FeedBlender on the RSS
standard library as it stood in (I believe) 1.8.2 preview 3, and it
worked fine. Now as I've come back to take a look at it, I suspect that
a change since then has made FeedBlender break.

Sorry, I'll fix.

                                                             The
tutorial at
http://www.cozmixng.org/~rwiki/?cmd=view;
name=RSS+Parser%3A%3ATutorial.en mentions the RSS::Maker, which seems
like a more Builder-style generation. But that tutorial also
specifically says Maker's API isn't fixed either.

Sorry, I didn't update the tutorial.
RSS::Maker's API is fixed.

···

Francis Hwang <sera@fhwang.net> wrote:

--
kou

Okay then. Now I've got a question about RSS::Maker. I'd like to be able to get the number of items in an RSS while making it. I tried this:

rss = RSS::Maker.make( '2.0' ) { |maker|
  ...
  while ( maker.items.size < 20 )
    ...
  end
}

but that doesn't work.

Francis Hwang

···

On Jan 13, 2005, at 12:06 AM, Kouhei Sutou wrote:

Sorry, I didn't update the tutorial.
RSS::Maker's API is fixed.

Hi,

In <20050113.140634.67873453.kou@cozmixng.org>
  "Re: An open question about the RSS stdlib" on Thu, 13 Jan 2005 14:06:45 +0900,

···

Kouhei Sutou <kou@cozmixng.org> wrote:

> Back in November, I built my RSS utility FeedBlender on the RSS
> standard library as it stood in (I believe) 1.8.2 preview 3, and it
> worked fine. Now as I've come back to take a look at it, I suspect that
> a change since then has made FeedBlender break.

Sorry, I'll fix.

Done.

--
kou

Hi,

In <BB8675BE-65D9-11D9-876D-000A95DBF456@fhwang.net>
  "Re: An open question about the RSS stdlib" on Fri, 14 Jan 2005 12:03:37 +0900,

                                                     I'd like to be
able to get the number of items in an RSS while making it. I tried
this:

rss = RSS::Maker.make( '2.0' ) { |maker|
  ...
  while ( maker.items.size < 20 )
    ...
  end
}

but that doesn't work.

Does it mean that you want maker.items to have size method?
Then I'll add it.

But, I recommend you to use maker.items.max_size=.

  rss = RSS::Maker.make( '2.0' ) { |maker|
    ...
    ... do
      item = maker.items.new_item
      item.title = ...
      ...
    end
    ...
    maker.items.max_size = 20
  }

If you want to get more example codes, see
test/rss/test_maker*.rb and sample/rss/blend.rb.

···

Francis Hwang <sera@fhwang.net> wrote:

--
kou

Thanks much. Any idea when the next preview release is coming out, so I don't have to say "Feedblender works if you get Ruby from CVS"? :wink:

Francis Hwang

···

On Jan 14, 2005, at 11:50 PM, Kouhei Sutou wrote:

Hi,

In <20050113.140634.67873453.kou@cozmixng.org>
  "Re: An open question about the RSS stdlib" on Thu, 13 Jan 2005 14:06:45 +0900,
  Kouhei Sutou <kou@cozmixng.org> wrote:

Back in November, I built my RSS utility FeedBlender on the RSS
standard library as it stood in (I believe) 1.8.2 preview 3, and it
worked fine. Now as I've come back to take a look at it, I suspect that
a change since then has made FeedBlender break.

Sorry, I'll fix.

Done.