line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
38982
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
3
|
|
|
|
|
|
|
package WWW::Sitemap::XML::URL; |
4
|
|
|
|
|
|
|
BEGIN { |
5
|
1
|
|
|
1
|
|
37
|
$WWW::Sitemap::XML::URL::AUTHORITY = 'cpan:AJGB'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
{ |
8
|
|
|
|
|
|
|
$WWW::Sitemap::XML::URL::VERSION = '1.121160'; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
#ABSTRACT: XML Sitemap url entry |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
504
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use WWW::Sitemap::XML::Types qw( Location ChangeFreq Priority ); |
14
|
|
|
|
|
|
|
use MooseX::Types::DateTime::W3C qw( DateTimeW3C ); |
15
|
|
|
|
|
|
|
use XML::LibXML; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'loc' => ( |
20
|
|
|
|
|
|
|
is => 'rw', |
21
|
|
|
|
|
|
|
isa => Location, |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
coerce => 1, |
24
|
|
|
|
|
|
|
predicate => 'has_loc', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has 'lastmod' => ( |
29
|
|
|
|
|
|
|
is => 'rw', |
30
|
|
|
|
|
|
|
isa => DateTimeW3C, |
31
|
|
|
|
|
|
|
required => 0, |
32
|
|
|
|
|
|
|
coerce => 1, |
33
|
|
|
|
|
|
|
predicate => 'has_lastmod', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has 'changefreq' => ( |
38
|
|
|
|
|
|
|
is => 'rw', |
39
|
|
|
|
|
|
|
isa => ChangeFreq, |
40
|
|
|
|
|
|
|
required => 0, |
41
|
|
|
|
|
|
|
predicate => 'has_changefreq', |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has 'priority' => ( |
46
|
|
|
|
|
|
|
is => 'rw', |
47
|
|
|
|
|
|
|
isa => Priority, |
48
|
|
|
|
|
|
|
required => 0, |
49
|
|
|
|
|
|
|
predicate => 'has_priority', |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub as_xml { |
54
|
|
|
|
|
|
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $url = XML::LibXML::Element->new('url'); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
do { |
59
|
|
|
|
|
|
|
my $name = $_; |
60
|
|
|
|
|
|
|
my $e = XML::LibXML::Element->new($name); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$e->appendText( $self->$name ); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
$url->appendChild( $e ); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
} for 'loc',grep { |
67
|
|
|
|
|
|
|
eval('$self->has_'.$_) || defined $self->$_() |
68
|
|
|
|
|
|
|
} qw( lastmod changefreq priority ); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
return $url; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
around BUILDARGS => sub { |
75
|
|
|
|
|
|
|
my $next = shift; |
76
|
|
|
|
|
|
|
my $class = shift; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
if ( @_ == 1 && ! ref $_[0] ) { |
79
|
|
|
|
|
|
|
return $class->$next(loc => $_[0]); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
return $class->$next( @_ ); |
82
|
|
|
|
|
|
|
}; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
with 'WWW::Sitemap::XML::URL::Interface'; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |
93
|
|
|
|
|
|
|
=pod |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=encoding utf-8 |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 NAME |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
WWW::Sitemap::XML::URL - XML Sitemap url entry |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 VERSION |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
version 1.121160 |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 SYNOPSIS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
my $url = WWW::Sitemap::XML::URL->new( |
108
|
|
|
|
|
|
|
loc => 'http://mywebsite.com/', |
109
|
|
|
|
|
|
|
lastmod => '2010-11-26', |
110
|
|
|
|
|
|
|
changefreq => 'always', |
111
|
|
|
|
|
|
|
priority => 1.0, |
112
|
|
|
|
|
|
|
); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
XML sample: |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
117
|
|
|
|
|
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> |
118
|
|
|
|
|
|
|
<url> |
119
|
|
|
|
|
|
|
<loc>http://mywebsite.com/</loc> |
120
|
|
|
|
|
|
|
<lastmod>2010-11-26</lastmod> |
121
|
|
|
|
|
|
|
<changefreq>always</changefreq> |
122
|
|
|
|
|
|
|
<priority>1.0</priority> |
123
|
|
|
|
|
|
|
</url> |
124
|
|
|
|
|
|
|
</urlset> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 DESCRIPTION |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
WWW::Sitemap::XML::URL represents single url entry in sitemap file. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Class implements L<WWW::Sitemap::XML::URL::Interface>. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 loc |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
$url->loc('http://mywebsite.com/') |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
URL of the page. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
isa: L<WWW::Sitemap::XML::Types/"Location"> |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Required. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 lastmod |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
The date of last modification of the page. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
isa: L<MooseX::Types::DateTime::W3C/"DateTimeW3C"> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Optional. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 changefreq |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
How frequently the page is likely to change. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
isa: L<WWW::Sitemap::XML::Types/"ChangeFreq"> |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Optional. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head2 priority |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
The priority of this URL relative to other URLs on your site. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
isa: L<WWW::Sitemap::XML::Types/"Priority"> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Optional. |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 METHODS |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head2 as_xml |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Returns L<XML::LibXML::Element> object representing the C<E<lt>urlE<gt>> entry in the sitemap. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head1 SEE ALSO |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Please see those modules/websites for more information related to this module. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=over 4 |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
L<WWW::Sitemap::XML|WWW::Sitemap::XML> |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
L<http://www.sitemaps.org/protocol.php> |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=back |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head1 AUTHOR |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Alex J. G. BurzyÅski <ajgb@cpan.org> |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This software is copyright (c) 2010 by Alex J. G. BurzyÅski <ajgb@cpan.org>. |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
199
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=cut |
202
|
|
|
|
|
|
|
|