line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Ov2::Grabber; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26002
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
706
|
|
6
|
1
|
|
|
1
|
|
403
|
use Module::Util qw( :all ); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Module::Runtime qw(is_valid_module_name require_module use_module use_package_optimistically is_valid_module_spec compose_module_name); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Geo::Ov2::Grabber - The great new Geo::Ov2::Grabber! |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Version 0.01_02 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.01_02'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our %grabber_modules; |
23
|
|
|
|
|
|
|
our $OVG = undef; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Quick summary of what the module does. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Perhaps a little code snippet. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use Geo::Ov2::Grabber; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $foo = Geo::Ov2::Grabber->new(); |
34
|
|
|
|
|
|
|
... |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 EXPORT |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
39
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 FUNCTIONS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 new |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub new { |
48
|
|
|
|
|
|
|
return $OVG if $OVG; |
49
|
|
|
|
|
|
|
my $class = shift; |
50
|
|
|
|
|
|
|
my $params = shift; |
51
|
|
|
|
|
|
|
my $self = {}; |
52
|
|
|
|
|
|
|
bless $self, $class; |
53
|
|
|
|
|
|
|
my $packagebase = __PACKAGE__; |
54
|
|
|
|
|
|
|
my $packagegrabber = "${packagebase}"; |
55
|
|
|
|
|
|
|
my @denied_grabbers = ( ); |
56
|
|
|
|
|
|
|
push @denied_grabbers, @{$$params{denied_grabbers}} if @{$$params{denied_grabbers}}; |
57
|
|
|
|
|
|
|
foreach my $module ( find_in_namespace( $packagegrabber ) ) { |
58
|
|
|
|
|
|
|
next if grep( /^$module$/, ( @denied_grabbers ) ); |
59
|
|
|
|
|
|
|
use_module( $module ); |
60
|
|
|
|
|
|
|
my $m = new $module; |
61
|
|
|
|
|
|
|
carp( sprintf "Duplicate grabber alias: %s!", $m->alias ) if exists $grabber_modules{$m->alias}; |
62
|
|
|
|
|
|
|
$grabber_modules{$m->alias} = $m; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
$OVG=$self; |
65
|
|
|
|
|
|
|
return $self; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub grab_all() { |
70
|
|
|
|
|
|
|
my $self = shift; |
71
|
|
|
|
|
|
|
my $error = 0; |
72
|
|
|
|
|
|
|
foreach my $i ( values %grabber_modules ) { |
73
|
|
|
|
|
|
|
$error = ( $error or $i->grab ); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
return $error; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub grab($) { |
79
|
|
|
|
|
|
|
my $self = shift; |
80
|
|
|
|
|
|
|
my $grabber = shift; |
81
|
|
|
|
|
|
|
return $grabber_modules{$grabber}->grab; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub list_grabbers { |
85
|
|
|
|
|
|
|
return keys %grabber_modules; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
hPa, C<< >> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 BUGS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
95
|
|
|
|
|
|
|
C, or through the web interface at |
96
|
|
|
|
|
|
|
L. |
97
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
98
|
|
|
|
|
|
|
your bug as I make changes. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SUPPORT |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
perldoc Geo::Ov2::Grabber |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
You can also look for information at: |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=over 4 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
L |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * CPAN Ratings |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
L |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item * Search CPAN |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
L |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=back |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Copyright 2007 hPa, all rights reserved. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
135
|
|
|
|
|
|
|
under the same terms as Perl itself. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; # End of Geo::Ov2::Grabber |