Load XML-Feed-0.01 into trunk.
[catagits/XML-Feed.git] / lib / XML / Feed / Entry.pm
CommitLineData
5ec68b3b 1# $Id: Entry.pm,v 1.1.1.1 2004/05/29 17:29:56 btrott Exp $
2
3package XML::Feed::Entry;
4use strict;
5
6sub wrap {
7 my $class = shift;
8 my($item) = @_;
9 bless { entry => $item }, $class;
10}
11
12sub title;
13sub link;
14sub content;
15sub summary;
16sub category;
17sub author;
18sub id;
19sub issued;
20sub modified;
21
221;
23__END__
24
25=head1 NAME
26
27XML::Feed::Entry - Entry/item in a syndication feed
28
29=head1 SYNOPSIS
30
31 ## $feed is an XML::Feed object.
32 for my $entry ($feed->entries) {
33 print $entry->title, "\n", $entry->summary, "\n\n";
34 }
35
36=head1 DESCRIPTION
37
38I<XML::Feed::Entry> represents an entry/item in an I<XML::Feed> syndication
39feed.
40
41=head1 USAGE
42
43=head2 $entry->title
44
45The title of the entry.
46
47=head2 $entry->link
48
49The permalink of the entry, in most cases, except in cases where it points
50instead of an offsite URI referenced in the entry.
51
52=head2 $entry->content
53
54The full entry body, or as much as is available in the feed.
55
56In RSS feeds, this method will look first for
57I<http://purl.org/rss/1.0/modules/content/#encoded> and
58I<http://www.w3.org/1999/xhtml#body> elements, then fall back to a
59I<E<lt>descriptionE<gt>> element.
60
61=head2 $entry->summary
62
63A short summary of the entry. Possibly.
64
65Since RSS feeds do not have the idea of a summary separate from the entry
66body, this may return the same value as the I<$entry-E<gt>content> method.
67But it won't always, even with RSS feeds. For example, a number of RSS feeds
68use an element like I<http://purl.org/rss/1.0/modules/content/#encoded>
69for the entry body and put an excerpt in the I<E<lt>descriptionE<gt>> element;
70in those cases, this method will return the excerpt.
71
72=head2 $entry->category
73
74The category in which the entry was posted.
75
76=head2 $entry->author
77
78The name or email address of the person who posted the entry.
79
80=head2 $entry->id
81
82The unique ID of the entry.
83
84=head2 $entry->issued
85
86A I<DateTime> object representing the date and time at which the entry
87was posted.
88
89=head2 $entry->modified
90
91A I<DateTime> object representing the last-modified date of the entry.
92
93=head1 AUTHOR & COPYRIGHT
94
95Please see the I<XML::Feed> manpage for author, copyright, and license
96information.
97
98=cut