use base qw( Class::ErrorHandler );
use Feed::Find;
use URI::Fetch;
+use LWP::UserAgent;
use Carp;
-our $VERSION = '0.12';
+our $VERSION = '0.22';
sub new {
my $class = shift;
my $feed = bless {}, $class;
my $xml = '';
if (UNIVERSAL::isa($stream, 'URI')) {
- my $res = URI::Fetch->fetch($stream)
+ my $ua = LWP::UserAgent->new;
+ $ua->env_proxy; # force allowing of proxies
+ my $res = URI::Fetch->fetch($stream, UserAgent => $ua)
or return $class->error(URI::Fetch->errstr);
return $class->error("This feed has been permanently removed")
if $res->status == URI::Fetch::URI_GONE();
if ($specified_format) {
$format = $specified_format;
} else {
- $feed->identify_format(\$xml) or return $class->error($feed->errstr);
+ $format = $feed->identify_format(\$xml) or return $class->error($feed->errstr);
}
my $format_class = join '::', __PACKAGE__, $format;
sub format;
sub title;
sub link;
+sub self_link;
sub description;
sub language;
sub author;
sub add_entry;
sub entries;
sub as_xml;
+sub id;
sub tagline { shift->description(@_) }
sub items { $_[0]->entries }
Creates a new empty I<XML::Feed> object using the format I<$format>.
+ $feed = XML::Feed->new('Atom');
+ $feed = XML::Feed->new('RSS');
+ $feed = XML::Feed->new('RSS', version => '0.91');
+
=head2 XML::Feed->parse($stream)
=head2 XML::Feed->parse($stream, $format)
The generator of the feed.
+=head2 $feed->self_link ([ $uri ])
+
+The Atom Self-link of the feed:
+
+L<http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html>
+
+A string.
+
=head2 $feed->entries
A list of the entries/items in the feed. Returns an array containing
=head1 AUTHOR & COPYRIGHT
-Except where otherwise noted, I<XML::Feed> is Copyright 2004-2005
+Except where otherwise noted, I<XML::Feed> is Copyright 2004-2008
Six Apart, cpan@sixapart.com. All rights reserved.
+=head1 SUBVERSION
+
+The latest version of I<XML::Feed> can be found at
+
+ http://code.sixapart.com/svn/XML-Feed/trunk/
+
=cut