Revision history for XML::Feed
+0.20
+ - Allow specification of the parsing format. Fixes bugs
+ http://rt.cpan.org/Public/Bug/Display.html?id=35580 and
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477394
+
0.12 2006.08.13
- Generate Atom 1.0 feeds by default. Thanks to Tatsuhiko Miyagawa for
the patch.
sub parse {
my $class = shift;
- my($stream) = @_;
+ my($stream, $specified_format) = @_;
return $class->error("Stream parameter is required") unless $stream;
my $feed = bless {}, $class;
my $xml = '';
}
return $class->error("Can't get feed XML content from $stream")
unless $xml;
- my $format = $feed->identify_format(\$xml)
- or return $class->error($feed->errstr);
+ my $format;
+ if ($specified_format) {
+ $format = $specified_format;
+ } else {
+ $feed->identify_format(\$xml) or return $class->error($feed->errstr);
+ }
+
my $format_class = join '::', __PACKAGE__, $format;
eval "use $format_class";
return $class->error("Unsupported format $format: $@") if $@;
=head2 XML::Feed->parse($stream)
+=head2 XML::Feed->parse($stream, $format)
+
Parses a syndication feed identified by I<$stream>. I<$stream> can be any
one of the following:
=back
+C<$format> allows you to override format guessing.
+
=head2 XML::Feed->find_feeds($uri)
Given a URI I<$uri>, use auto-discovery to find all of the feeds linked