Load XML-Feed-0.04 into trunk.
[catagits/XML-Feed.git] / lib / XML / Feed / Entry.pm
CommitLineData
fe71566d 1# $Id: Entry.pm 942 2004-12-31 23:01:21Z btrott $
0d5e38d1 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
fe71566d 50instead to an offsite URI referenced in the entry.
0d5e38d1 51
52=head2 $entry->content
53
a749d9b9 54Bn I<XML::Feed::Content> object representing the full entry body, or as
55much as is available in the feed.
0d5e38d1 56
57In RSS feeds, this method will look first for
58I<http://purl.org/rss/1.0/modules/content/#encoded> and
59I<http://www.w3.org/1999/xhtml#body> elements, then fall back to a
60I<E<lt>descriptionE<gt>> element.
61
62=head2 $entry->summary
63
a749d9b9 64An I<XML::Feed::Content> object representing a short summary of the entry.
65Possibly.
0d5e38d1 66
67Since RSS feeds do not have the idea of a summary separate from the entry
a749d9b9 68body, this may not always be what you want. If the entry contains both a
69I<E<lt>descriptionE<gt>> element B<and> another element typically used for
70the full content of the entry--either I<http://www.w3.org/1999/xhtml/body>
71or I<http://purl.org/rss/1.0/modules/content/#encoded>--we treat that as
72the summary. Otherwise, we assume that there isn't a summary, and return
73an I<XML::Feed::Content> object with an empty string in the I<body>.
0d5e38d1 74
75=head2 $entry->category
76
77The category in which the entry was posted.
78
79=head2 $entry->author
80
81The name or email address of the person who posted the entry.
82
83=head2 $entry->id
84
85The unique ID of the entry.
86
87=head2 $entry->issued
88
89A I<DateTime> object representing the date and time at which the entry
90was posted.
91
92=head2 $entry->modified
93
94A I<DateTime> object representing the last-modified date of the entry.
95
96=head1 AUTHOR & COPYRIGHT
97
98Please see the I<XML::Feed> manpage for author, copyright, and license
99information.
100
101=cut