line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Atom::Ext::OpenSearch; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
24912
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base qw( XML::Atom::Base ); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
857
|
|
7
|
|
|
|
|
|
|
use XML::Atom::Feed; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use XML::Atom::Ext::OpenSearch::Query; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
XML::Atom::Ext::OpenSearch - XML::Atom extension for OpenSearch data |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use XML::Atom::Feed; |
20
|
|
|
|
|
|
|
use XML::Atom::Ext::OpenSearch; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $feed = XML::Atom::Feed->new; |
23
|
|
|
|
|
|
|
$feed->totalResults( $total ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This module is an extension to XML::Atom which will let you read and write |
28
|
|
|
|
|
|
|
feeds that use OpenSearch data. OpenSearch provides some extra elements |
29
|
|
|
|
|
|
|
to serialize search results as an Atom feed. See |
30
|
|
|
|
|
|
|
the specification (http://www.opensearch.org/Specifications/OpenSearch/1.1) |
31
|
|
|
|
|
|
|
for more information. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 totalResults( $results ) |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 startIndex( $index ) |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 itemsPerPage( $items ) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 Query( ) |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
In list context, returns all query elements in the document. In scalar |
44
|
|
|
|
|
|
|
context, returns the first query element found. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 add_Query( $object ) |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
BEGIN { |
51
|
|
|
|
|
|
|
XML::Atom::Feed->mk_elem_accessors( |
52
|
|
|
|
|
|
|
qw(totalResults startIndex itemsPerPage), |
53
|
|
|
|
|
|
|
[ XML::Atom::Namespace->new( |
54
|
|
|
|
|
|
|
"opensearch" => q{http://a9.com/-/spec/opensearch/1.1/} |
55
|
|
|
|
|
|
|
) |
56
|
|
|
|
|
|
|
] |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
XML::Atom::Feed->mk_object_list_accessor( |
60
|
|
|
|
|
|
|
Query => 'XML::Atom::Ext::OpenSearch::Query' ); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 element_ns( ) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns the opensearch namespace, C. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub element_ns { |
70
|
|
|
|
|
|
|
return XML::Atom::Namespace->new( |
71
|
|
|
|
|
|
|
"opensearch" => q{http://a9.com/-/spec/opensearch/1.1/} ); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Brian Cassidy Ebricas@cpan.orgE |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Copyright 2007-2011 by Brian Cassidy |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
83
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SEE ALSO |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=over 4 |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item * L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |