line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::GoKGS::Scraper::TzList; |
2
|
9
|
|
|
9
|
|
1490
|
use strict; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
329
|
|
3
|
9
|
|
|
9
|
|
53
|
use warnings; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
270
|
|
4
|
9
|
|
|
9
|
|
51
|
use parent qw/WWW::GoKGS::Scraper/; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
74
|
|
5
|
9
|
|
|
9
|
|
1304
|
use WWW::GoKGS::Scraper::Declare; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
81
|
|
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
1
|
64
|
sub base_uri { 'http://www.gokgs.com/tzList.jsp' } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub __build_scraper { |
10
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
scraper { |
13
|
|
|
|
|
|
|
process '//option', 'time_zones[]' => { |
14
|
|
|
|
|
|
|
# tzdata-compatible name of time zone (maybe or maybe not) |
15
|
0
|
|
|
|
|
|
name => sub { $_[0]->attr('value') }, |
16
|
|
|
|
|
|
|
# java.util.TimeZone's getDisplayName (long version, maybe) |
17
|
|
|
|
|
|
|
# obviously useless, but harmless :) |
18
|
0
|
|
|
|
|
|
display_name => [ 'TEXT', sub { s/ \([^\)]+\)$// } ], |
19
|
0
|
|
|
0
|
|
|
selected => sub { $_[0]->attr('selected') } }; |
|
0
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
10
|
}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub scrape { |
24
|
0
|
|
|
0
|
1
|
|
my ( $self, @args ) = @_; |
25
|
0
|
|
|
|
|
|
my $result = $self->SUPER::scrape( @args ); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
for my $time_zone ( @{$result->{time_zones}} ) { |
|
0
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
|
next unless delete $time_zone->{selected}; |
29
|
0
|
|
|
|
|
|
$result->{current_time_zone} = { %$time_zone }; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$result; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |