using the RSS standard lib

F

Francis Hwang

Is anybody out there using the RSS standard lib that comes with Ruby
1.8.2? I'm trying to make use of it but am finding the lack of
documentation frustrating.

Also, is it possible to use this to do parsing of multiple feeds each
of a different version? Require "rss/2.0" seems to force me to use 2.0
parsing for all my feeds, but what if I'm parsing a bunch of feeds with
different versions?

Francis
 
A

Austin Ziegler

Is anybody out there using the RSS standard lib that comes with Ruby
1.8.2? I'm trying to make use of it but am finding the lack of
documentation frustrating.

It's worse when you try to read the source, since it's not conformant
to the rest of the Ruby codebase standard.
Also, is it possible to use this to do parsing of multiple feeds each
of a different version? Require "rss/2.0" seems to force me to use 2.0
parsing for all my feeds, but what if I'm parsing a bunch of feeds with
different versions?

I haven't seen anything that allows you to do anything smart like this.

-austin
 
N

Nikolai Weibull

* Francis Hwang said:
Also, is it possible to use this to do parsing of multiple feeds each
of a different version? Require "rss/2.0" seems to force me to use 2.0
parsing for all my feeds, but what if I'm parsing a bunch of feeds with
different versions?

Straight from Tutorial.en from rss-0.0.9:

Include this if you want to handle RSS 0.9x/1.0/2.0:

require 'rss/1.0'
require 'rss/2.0'

You don't need including it because of RSS 2.0 includes RSS 0.9x:

require 'rss/0.9'

Sure, there's no documentation in /usr/lib/ruby/1.8, but there's
certainly documentation available. Look for rss on raa. Didn't take
much work. Good luck,
nikolai
 
D

Dave Thomas

Is anybody out there using the RSS standard lib that comes with Ruby
1.8.2? I'm trying to make use of it but am finding the lack of
documentation frustrating.

I'm using it every day to create RSS feeds from non RSS sources (such
as CVS commit logs and amazon sales ranks).

There's documentation and examples of using it in the new PickAxe (he
says, at the risk of sounding like a salesman).


Cheers

Dave
 
F

Francis Hwang

I guess I just saw no RDoc over at the Ruby-doc.org standard lib page (
http://www.ruby-doc.org/stdlib/ ) and assumed that was the end of that.
I always forget to look over at RAA, so thanks for that reminder.

May I humbly suggest that at least there could be a pointer to the
tutorial buried in the .rb files? I mean, I'm familiar enough with Ruby
that I should've thought to look at RAA, but not every Ruby user is.

Francis


* Francis Hwang said:
Also, is it possible to use this to do parsing of multiple feeds each
of a different version? Require "rss/2.0" seems to force me to use 2.0
parsing for all my feeds, but what if I'm parsing a bunch of feeds
with
different versions?

Straight from Tutorial.en from rss-0.0.9:

Include this if you want to handle RSS 0.9x/1.0/2.0:

require 'rss/1.0'
require 'rss/2.0'

You don't need including it because of RSS 2.0 includes RSS 0.9x:

require 'rss/0.9'

Sure, there's no documentation in /usr/lib/ruby/1.8, but there's
certainly documentation available. Look for rss on raa. Didn't take
much work. Good luck,
nikolai

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
 
N

Nikolai Weibull

* Francis Hwang said:
I guess I just saw no RDoc over at the Ruby-doc.org standard lib page (
http://www.ruby-doc.org/stdlib/ ) and assumed that was the end of that.
I always forget to look over at RAA, so thanks for that reminder.

May I humbly suggest that at least there could be a pointer to the
tutorial buried in the .rb files? I mean, I'm familiar enough with Ruby
that I should've thought to look at RAA, but not every Ruby user is.

Yeah, the documentation of the standard libraries is lacking for many
libraries (look at mkmf for example...it's a pain trying to figure out
what you can do with it).
nikolai
 
N

Nathaniel Talbott

I'm using it every day to create RSS feeds from non RSS sources (such
as CVS commit logs and amazon sales ranks).

There's documentation and examples of using it in the new PickAxe (he
says, at the risk of sounding like a salesman).

Question for the group, while we're on the topic: I've just started
using it to generate feeds myself (for the blog I'm writing)... is
there any way to get it to output a bit cleaner? There's tons of
extraneous whitespace in the generated XML.

Thanks,


Nathaniel
Terralien, Inc.

<:((><
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"Re: using the RSS standard lib" on Thu, 14 Oct 2004 07:13:13 +0900,
Francis Hwang said:
May I humbly suggest that at least there could be a pointer to the
tutorial buried in the .rb files? I mean, I'm familiar enough with Ruby

Thank you for your suggestion.
I added a pointer to lib/rss/rss.rb.
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"Re: using the RSS standard lib" on Thu, 14 Oct 2004 10:29:25 +0900,
Nathaniel Talbott said:
is
there any way to get it to output a bit cleaner? There's tons of
extraneous whitespace in the generated XML.

Which of `tab indent' and `two or more new-lines' is your
problem? Or both?

If your answer is the first one, please wait. I'll change
`tab indent' of outputted RSS and source code to two spaces
indent.
 
J

James Britt

Francis said:
I guess I just saw no RDoc over at the Ruby-doc.org standard lib page (
http://www.ruby-doc.org/stdlib/ ) and assumed that was the end of that.
I always forget to look over at RAA, so thanks for that reminder.

May I humbly suggest that at least there could be a pointer to the
tutorial buried in the .rb files? I mean, I'm familiar enough with Ruby
that I should've thought to look at RAA, but not every Ruby user is.

Might it not be better to ensure that such documentation is readily
available from the Rdoc files in the first place? If something is being
included as part of the standard library then its documentation should
be complete and easily accessible.

Why should one have to think of it as a stand-alone project in order to
locate the docs?


James
 
G

gabriele renzi

Kouhei Sutou ha scritto:
Thank you for your suggestion.
I added a pointer to lib/rss/rss.rb.

while we're talking about RSS.. it is planed to ever support ATOM or is
that too much a different beast?
 
N

Nathaniel Talbott

Which of `tab indent' and `two or more new-lines' is your
problem? Or both?

If your answer is the first one, please wait. I'll change
`tab indent' of outputted RSS and source code to two spaces
indent.

I'm glad to hear the indentation is changing, but the multiple newlines
in the outputted XML is more what I was talking about:

<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>talbott.ws</title>
<link>http://homeplace/</link>
<description>The Talbott family's blog.</description>
... 11 newlines ...
<item>
<title>Another post!</title>

<link>http://homeplace/weblog/permalink/2004/10/12/another-post.html</
link>
<description>&lt;p&gt;Stuff!!!&lt;/p&gt;</description>
...5 newlines...
<pubDate>Tue, 12 Oct 2004 20:35:02 -0400</pubDate>

It doesn't affect the function of the feed at all, but I guess I'm just
a bit picky about the form of things. Is there already a way to clean
this up? If not, can you add one?

Thanks,


Nathaniel
Terralien, Inc.

<:((><
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"Re: using the RSS standard lib" on Fri, 15 Oct 2004 22:32:15 +0900,
Nathaniel Talbott said:
I'm glad to hear the indentation is changing, but the multiple newlines
in the outputted XML is more what I was talking about: (snip)
a bit picky about the form of things. Is there already a way to clean
this up? If not, can you add one?

I added it and committed. Please try it.


I'll add convenient API for making new RSS soon. If someone
has some ideas, please tell me.
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"Re: using the RSS standard lib" on Thu, 14 Oct 2004 17:34:36 +0900,
gabriele renzi said:
while we're talking about RSS.. it is planed to ever support ATOM or is
that too much a different beast?

I think it is not work of RSS Parser. It is the talk of the
layer above RSS Parser.


Would you write multiple feeds parser? ;)
 
G

gabriele renzi

Kouhei Sutou ha scritto:
Hi,

In <[email protected]>
"Re: using the RSS standard lib" on Thu, 14 Oct 2004 17:34:36 +0900,



I think it is not work of RSS Parser. It is the talk of the
layer above RSS Parser.


Would you write multiple feeds parser? ;)
well, a friend of mine is the author of atom.NET..
if I can force him to switch to ruby.. ;)
 
S

Sam Roberts

Quoteing (e-mail address removed), on Thu, Oct 14, 2004 at 06:49:04AM +0900:
Straight from Tutorial.en from rss-0.0.9:

That tutorial doesn't hold for ruby1.8. Ruby1.8 doesn't have
a rss/maker, so the whole encoding section at the bottom isn't too
helpful. No idea if the parsing part is good.

Anybody know what happened to rss/maker?
Sure, there's no documentation in /usr/lib/ruby/1.8, but there's
certainly documentation available. Look for rss on raa. Didn't take
much work. Good luck,

How exactly would anybody know WHICH of the many RSS libs on the RAA was
adopted into ruby?

Thanks,
Sam
 
J

James Britt

Sam said:
Quoteing (e-mail address removed), on Thu, Oct 14, 2004 at 06:49:04AM +0900:



That tutorial doesn't hold for ruby1.8. Ruby1.8 doesn't have
a rss/maker, so the whole encoding section at the bottom isn't too
helpful. No idea if the parsing part is good.

Anybody know what happened to rss/maker?

It appears that 1.8.2 preview 3 has an rss/maker section, but when I
tried to run rdoc over this code I got a SystemStackError error:


/usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol': stack
level too deep (SystemStackError)
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
... 2118 levels...
from
/usr/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1210:in
`generate_html'
from
/usr/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1130:in `generate'
from /usr/local/lib/ruby/1.8/rdoc/rdoc.rb:269:in `document'
from /usr/local/bin/rdoc:63



This is using ruby 1.8.2 (2004-07-29) [i586-linux]
running rdoc from the /lib/rss directory of the preview 3 source code



James
 
S

Sam Roberts

Quoteing (e-mail address removed), on Fri, Nov 12, 2004 at 01:28:51PM +0900:
Ok, I still don't know what happened, but I think the darwinports version of
the preview doesn't have rss/maker, but has the rest. I'm a little confused.

Anyhow, I downloaded and manually installed rss1.0 from the RAA, and I have
rss/maker.

Sorry!
It appears that 1.8.2 preview 3 has an rss/maker section, but when I
tried to run rdoc over this code I got a SystemStackError error:


/usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol': stack
level too deep (SystemStackError)
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
from /usr/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in
`find_symbol'
... 2118 levels...
from
/usr/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1210:in
`generate_html'
from
/usr/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1130:in `generate'
from /usr/local/lib/ruby/1.8/rdoc/rdoc.rb:269:in `document'
from /usr/local/bin/rdoc:63



This is using ruby 1.8.2 (2004-07-29) [i586-linux]
running rdoc from the /lib/rss directory of the preview 3 source code

I get similar results, too, see below.
Sam


maker.rb: mmc.
lib/rss/maker.rb:12:38: Skipping require of dynamic string: "#{prefix}/#{version}"

lib/rss/maker.rb:14:36: Skipping require of dynamic string: "#{prefix}/#{mod}"
...
parser.rb: mc.c.c.c.cc....c.......cc.......m............
rexmlparser.rb: mc..c.
rss.rb: cc.m.mcc.cc.c.c.c.c.c.c.c.m.......cc.......................m....
syndication.rb: mm....cc
taxonomy.rb: mm
lib/rss/taxonomy.rb:24:54: unexpected token: '#<RubyToken::TkLPAREN:0x6e7328 @text="(", @char_no=15, @line_no=22>'
cccc
trackback.rb: mm.m.cc.....cc.....m...cc...cc...ccccc
utils.rb: mm..
xml-stylesheet.rb: mm..c
lib/rss/xml-stylesheet.rb:35:29: unexpected token: '#<RubyToken::TkLPAREN:0x75e8d8 @text="(", @char_no=17, @line_no=35>'
.....
xmlparser.rb: mcmcmc......c..c.
xmlscanner.rb: mc..c..............
Generating HTML...
/opt/local/lib/ruby/1.8/rdoc/code_objects.rb:327:in `find_symbol': stack level too deep (SystemStackError)
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
from /opt/local/lib/ruby/1.8/rdoc/code_objects.rb:328:in `find_symbol'
... 634 levels...
from /opt/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1210:in `generate_html'
from /opt/local/lib/ruby/1.8/rdoc/generators/html_generator.rb:1130:in `generate'
from /opt/local/lib/ruby/1.8/rdoc/rdoc.rb:269:in `document'
from /opt/local/bin/rdoc:63
 
D

Dave Thomas

It appears that 1.8.2 preview 3 has an rss/maker section, but when I
tried to run rdoc over this code I got a SystemStackError error:

Strange: I just ran the latest RDoc against that directory. I got a
warning about an unexpected token in xml-stylesheet.rb, but no
SystemStackError.

Could you tell me if you see this with the latest RDoc from CVS?

Cheers

Dave
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,427
Latest member
HildredDic

Latest Threads

Top