Up version
[catagits/XML-Feed.git] / lib / XML / Feed.pm
index ee6cdd5..59c25b6 100644 (file)
@@ -6,9 +6,10 @@ use strict;
 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;
@@ -30,7 +31,9 @@ sub parse {
     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();
@@ -55,7 +58,7 @@ sub parse {
     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;
@@ -124,6 +127,7 @@ sub splice {
 sub format;
 sub title;
 sub link;
+sub self_link;
 sub description;
 sub language;
 sub author;
@@ -133,6 +137,7 @@ sub generator;
 sub add_entry;
 sub entries;
 sub as_xml;
+sub id;
 
 sub tagline { shift->description(@_) }
 sub items   { $_[0]->entries     }
@@ -192,6 +197,10 @@ I<DateTime> objects, which it then returns to the caller.
 
 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)
@@ -280,6 +289,14 @@ If present, I<$modified> should be a I<DateTime> object.
 
 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
@@ -318,7 +335,13 @@ under the same terms as Perl itself.
 
 =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