| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Egg::Release::XML::FeedPP; |
|
2
|
|
|
|
|
|
|
# |
|
3
|
|
|
|
|
|
|
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# $Id: FeedPP.pm 211 2007-11-03 14:41:11Z lushe $ |
|
6
|
|
|
|
|
|
|
# |
|
7
|
2
|
|
|
2
|
|
41915
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
114
|
|
|
8
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
157
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Egg::Release::XML::FeedPP - XML::FeedPP module kit for Egg. |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
When RSS Feed is treated, XML::FeedPP is very convenient. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
MODEL and VIEW to use the XML::FeedPP were enclosed. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 EXAMPLE |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Mounting Model arrives and the method of XML::FeedPP is called with AUTOLOAD easily. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Therefore, it is recommended to receive the XML::FeedPP object by the feed method, |
|
27
|
|
|
|
|
|
|
and to operate it directly. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $feed= $e->model('FeedPP')->feed('http://domain.name/index.rdf'); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
.... |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Please see the document of L<XML::FeedPP> in detail. |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
see L<Egg::Model::FeedPP>. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 VIEW |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Mounting VIEW is a little tactful from MODEL. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
After content_type and charset are set, the content trained to XML::FeedPP is output. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The character-code should be likely to be converted. |
|
44
|
|
|
|
|
|
|
You will use the Encode plug-in for it. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $feed= $e->default_view('FeedPP')->feed; |
|
47
|
|
|
|
|
|
|
$feed->title('MY BLOG'); |
|
48
|
|
|
|
|
|
|
$feed->link('http://myblog.domain.name/'); |
|
49
|
|
|
|
|
|
|
for my $item (@items) { |
|
50
|
|
|
|
|
|
|
$feed->add_item( $item->{url}, |
|
51
|
|
|
|
|
|
|
title => $e->utf8_conv(\$item->{title}), |
|
52
|
|
|
|
|
|
|
description => $e->utf8_conv(\$item->{description}), |
|
53
|
|
|
|
|
|
|
); |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
# The output is left to Egg. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
see L<Egg::View::FeedPP>. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
L<Egg::Model::FeedPP>, |
|
62
|
|
|
|
|
|
|
L<Egg::View::FeedPP>, |
|
63
|
|
|
|
|
|
|
L<XML::FeedPP>, |
|
64
|
|
|
|
|
|
|
L<Egg::Release>, |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Copyright (C) 2007 by Bee Flag, Corp. E<lt>http://egg.bomcity.com/E<gt>, All Rights Reserved. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
|
75
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.6 or, |
|
76
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |