Subject: | Doesn't handle RSS 1.0 feeds - patch included |
XML::RSS::Parser::Lite doesn't recognize RSS 1.0 feeds because they use a different XML namespace. The attached patch adds RSS 1.0 support.
Merging this patch would be appreciated, as I have a project that depends on it. I really want to distribute against CPAN instead of bundling an unofficial fix.
Thanks in advance!
--- /usr/lib/perl5/site_perl/5.8.0/XML/RSS/Parser/Lite.pm 2004-01-12 05:17:24.000000000 -0500
+++ Lite.pm 2004-01-12 05:19:51.000000000 -0500
@@ -2,7 +2,7 @@
use strict;
-our $VERSION = '0.10';
+our $VERSION = '0.11';
sub new {
my $class = shift;
@@ -88,6 +88,7 @@
$self->{place} .= "/$tag";
$self->{latest} = $self->add if ($self->{place} eq '/rss/channel/item');
+ $self->{latest} = $self->add if ($self->{place} eq '/rdf:RDF/item');
}
sub char {
@@ -97,6 +98,9 @@
$self->{latest}->set('title', $text) if ($self->{place} eq '/rss/channel/item/title');
$self->{latest}->set('url', $text) if ($self->{place} eq '/rss/channel/item/link');
$self->{latest}->set('description', $text) if ($self->{place} eq '/rss/channel/item/description');
+ $self->{latest}->set('title', $text) if ($self->{place} eq '/rdf:RDF/item/title');
+ $self->{latest}->set('url', $text) if ($self->{place} eq '/rdf:RDF/item/link');
+ $self->{latest}->set('description', $text) if ($self->{place} eq '/rdf:RDF/item/description');
$self->{title} = $text if ($self->{place} eq '/rss/channel/title');
$self->{url} = $text if ($self->{place} eq '/rss/channel/link');
@@ -110,6 +114,9 @@
my $place = $self->{place};
$place = substr($place, 0, length($place)-length($tag)-1); # regex here causes segmentation fault!
$self->{place} = $place;
+ $self->{title} = $text if ($self->{place} eq '/rdf:RDF/channel/title');
+ $self->{url} = $text if ($self->{place} eq '/rdf:RDF/channel/link');
+ $self->{description} = $text if ($self->{place} eq '/rdf:RDF/channel/description');
}