change the User Agent string
[catagits/XML-Feed.git] / lib / XML / Feed.pm
index b8d7962..d51ab5b 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 package XML::Feed;
 use strict;
 
@@ -12,7 +10,7 @@ use Module::Pluggable search_path => "XML::Feed::Format",
                       require     => 1,
                       sub_name    => 'formatters';
 
-our $VERSION = '0.46';
+our $VERSION = '0.50';
 our $MULTIPLE_ENCLOSURES = 0;
 our @formatters;
 BEGIN {
@@ -40,6 +38,7 @@ sub parse {
     my $xml = '';
     if (UNIVERSAL::isa($stream, 'URI')) {
         my $ua  = LWP::UserAgent->new;
+        $ua->agent(__PACKAGE__ . "/$VERSION");
         $ua->env_proxy; # force allowing of proxies
         my $res = URI::Fetch->fetch($stream, UserAgent => $ua)
             or return $class->error(URI::Fetch->errstr);
@@ -165,10 +164,20 @@ sub add_entry;
 sub entries;
 sub as_xml;
 sub id;
+sub image;
 
 sub tagline { shift->description(@_) }
 sub items   { $_[0]->entries     }
 
+# RFC 5005
+sub first_link;
+sub last_link;
+sub previous_link;
+sub next_link;
+sub current_link;
+sub prev_archive_link;
+sub next_archive_link;
+
 1;
 __END__
 
@@ -213,10 +222,10 @@ the various syndication formats. The different flavors of RSS and Atom
 handle data in different ways: date handling; summaries and content;
 escaping and quoting; etc. This module attempts to remove those differences
 by providing a wrapper around the formats and the classes implementing
-those formats (I<XML::RSS> and I<XML::Atom::Feed>). For example, dates are
+those formats (L<XML::RSS> and L<XML::Atom::Feed>). For example, dates are
 handled differently in each of the above formats. To provide a unified API for
 date handling, I<XML::Feed> converts all date formats transparently into
-I<DateTime> objects, which it then returns to the caller.
+L<DateTime> objects, which it then returns to the caller.
 
 =head1 USAGE
 
@@ -232,7 +241,8 @@ Creates a new empty I<XML::Feed> object using the format I<$format>.
 
 =head2 XML::Feed->parse($stream, $format)
 
-Parses a syndication feed identified by I<$stream>. I<$stream> can be any
+Parses a syndication feed identified by I<$stream> and returns an
+I<XML::Feed> obhect. I<$stream> can be any
 one of the following:
 
 =over 4
@@ -335,15 +345,15 @@ A string.
 =head2 $feed->entries
 
 A list of the entries/items in the feed. Returns an array containing
-I<XML::Feed::Entry> objects.
+L<XML::Feed::Entry> objects.
 
 =head2 $feed->items
 
-A synonym for I<$feed->entries>.
+A synonym (alias) for <$feed-E<gt>entries>.
 
 =head2 $feed->add_entry($entry)
 
-Adds an entry to the feed. I<$entry> should be an I<XML::Feed::Entry>
+Adds an entry to the feed. I<$entry> should be an L<XML::Feed::Entry>
 object in the correct format for the feed.
 
 =head2 $feed->as_xml
@@ -351,6 +361,36 @@ object in the correct format for the feed.
 Returns an XML representation of the feed, in the format determined by
 the current format of the I<$feed> object.
 
+=head2 $feed->first_link ([ $uri ])
+
+The Atom First-link for feed paging and archiving (RFC 5005).
+
+L<http://tools.ietf.org/html/rfc5005>
+
+=head2 $feed->last_link ([ $uri ])
+
+The Atom Last-link for feed paging and archiving.
+
+=head2 $feed->next_link ([ $uri ])
+
+The Atom Next-link for feed paging and archiving.
+
+=head2 $feed->previous_link ([ $uri ])
+
+The Atom Previous-link for feed paging and archiving.
+
+=head2 $feed->current_link ([ $uri ])
+
+The Atom Current-link for feed paging and archiving.
+
+=head2 $feed->next_archive_link ([ $uri ])
+
+The Atom Next-link for feed paging and archiving.
+
+=head2 $feed->prev_archive_link ([ $uri ])
+
+The Atom Prev-Archive-link for feed paging and archiving.
+
 =head1 PACKAGE VARIABLES
 
 =over 4
@@ -430,12 +470,16 @@ under the same terms as Perl itself.
 =head1 AUTHOR & COPYRIGHT
 
 Except where otherwise noted, I<XML::Feed> is Copyright 2004-2008
-Six Apart, cpan@sixapart.com. All rights reserved.
+Six Apart. All rights reserved.
+
+=head1 SUPPORT
+
+For support contact the XML::Feed mailing list - xml-feed@perlhacks.com.
 
-=head1 SUBVERSION 
+=head1 SOURCE CODE
 
 The latest version of I<XML::Feed> can be found at
 
-    http://code.sixapart.com/svn/XML-Feed/trunk/
+    http://github.com/davorg/XML-Feed
 
 =cut