line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Feed::Source::Yahoo; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
31213
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
78
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1088
|
use URI; |
|
1
|
|
|
|
|
24482
|
|
|
1
|
|
|
|
|
44
|
|
8
|
|
|
|
|
|
|
use constant { |
9
|
1
|
|
|
|
|
301
|
URL => "http://api.search.yahoo.com/WebSearchService/rss/webSearch.xml", |
10
|
1
|
|
|
1
|
|
13
|
}; |
|
1
|
|
|
|
|
2
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Feed::Source::Yahoo - Create a RSS feed based on a Yahoo query |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 VERSION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Version 0.01 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
If you query Yahoo regurlarly with the same search, maybe is it a good idea to |
27
|
|
|
|
|
|
|
transform this query in a RSS feed. This simple module can help you : |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Feed::Source::Yahoo; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $feed = Feed::Source::Yahoo->new( query => '"information retrieval"'); |
32
|
|
|
|
|
|
|
print "The feed URL: " . $feed->url() . "\n"; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 FUNCTIONS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 new |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
0
|
|
|
0
|
1
|
|
my ($class, %arg) = @_; |
42
|
0
|
|
|
|
|
|
my $self = {}; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$self->{URI} = URI->new(URL); |
45
|
0
|
|
|
|
|
|
$self->{params}{appid} = "yahoosearchwebrss"; |
46
|
0
|
0
|
|
|
|
|
$self->{params}{query} = $arg{query} if exists $arg{query}; |
47
|
0
|
|
|
|
|
|
bless $self, $class; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 url |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub url { |
55
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
56
|
0
|
0
|
|
|
|
|
if (exists $self->{params}{query}) { |
57
|
0
|
|
|
|
|
|
$self->{URI}->query_form($self->{params}); |
58
|
0
|
|
|
|
|
|
$self->{URI}->as_string |
59
|
|
|
|
|
|
|
} else { |
60
|
0
|
|
|
|
|
|
croak "You must specify a query..."; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 query |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub query { |
69
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
70
|
0
|
0
|
|
|
|
|
$self->{params}{query} = shift if @_; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Emmanuel Di Pretoro, C<< <> >> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 BUGS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
81
|
|
|
|
|
|
|
C, or through the web interface at |
82
|
|
|
|
|
|
|
L. |
83
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
84
|
|
|
|
|
|
|
your bug as I make changes. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SUPPORT |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
perldoc Feed::Source::Yahoo |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
You can also look for information at: |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=over 4 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
L |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * CPAN Ratings |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
L |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
L |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * Search CPAN |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
L |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=back |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Copyright 2006 Manu, all rights reserved. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
121
|
|
|
|
|
|
|
under the same terms as Perl itself. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; # End of Feed::Source::Yahoo |