line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::GoKGS::Scraper::TournInfo; |
2
|
9
|
|
|
9
|
|
1110
|
use strict; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
311
|
|
3
|
9
|
|
|
9
|
|
47
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
269
|
|
4
|
9
|
|
|
9
|
|
45
|
use parent qw/WWW::GoKGS::Scraper/; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
46
|
|
5
|
9
|
|
|
9
|
|
949
|
use WWW::GoKGS::Scraper::Declare; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
69
|
|
6
|
9
|
|
|
9
|
|
6385
|
use WWW::GoKGS::Scraper::TournLinks; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
10507
|
|
7
|
|
|
|
|
|
|
|
8
|
10
|
|
|
10
|
1
|
53
|
sub base_uri { 'http://www.gokgs.com/tournInfo.jsp' } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub __build_scraper { |
11
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
12
|
1
|
|
|
|
|
4
|
my $links = $self->__build_tourn_links; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
scraper { |
15
|
0
|
|
|
|
|
|
process '//h1', 'name' => [ 'TEXT', sub { s/\s+\([^)]+\)$// } ], |
16
|
0
|
0
|
|
0
|
|
|
'notes' => [ 'TEXT', sub { m/\s+\(([^)]+)\)$/ && $1 } ]; |
|
0
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
process '//a[@href="tzList.jsp"]', 'time_zone' => 'TEXT'; |
18
|
|
|
|
|
|
|
process '//node()[preceding-sibling::h1 and following-sibling::div]', |
19
|
0
|
|
|
|
|
|
'description[]' => sub { $_[0]->as_XML }; |
|
0
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
process '//div[@class="tournData"]', 'links' => $links; |
21
|
1
|
|
|
|
|
19
|
}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub scrape { |
25
|
0
|
|
|
0
|
1
|
|
my ( $self, @args ) = @_; |
26
|
0
|
|
|
|
|
|
my $result = $self->SUPER::scrape( @args ); |
27
|
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
|
if ( exists $result->{description} ) { |
29
|
0
|
|
|
|
|
|
$result->{description} = join q{}, @{$result->{description}}; |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$result; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |