File Coverage

blib/lib/WWW/MobileCarrierJP/Softbank/Service.pm
Criterion Covered Total %
statement 15 16 93.7
branch 0 2 0.0
condition n/a
subroutine 5 6 83.3
pod n/a
total 20 24 83.3


line stmt bran cond sub pod time code
1             package WWW::MobileCarrierJP::Softbank::Service;
2 1     1   878 use strict;
  1         2  
  1         46  
3 1     1   7 use warnings;
  1         2  
  1         37  
4 1     1   7 use utf8;
  1         2  
  1         9  
5 1     1   32 use charnames ':full';
  1         2  
  1         11  
6 1     1   271 use WWW::MobileCarrierJP::Declare;
  1         2  
  1         11  
7              
8             my $url = 'http://creation.mb.softbank.jp/mc/terminal/terminal_info/terminal_service.html';
9             my $xpath = '//div[@class="terminaltable"]/table/tr[ not(@bgcolor="#cccccc") and count(child::td) != 1 and position() != 1 ]';
10              
11             parse_one(
12             urls => [$url],
13             xpath => $xpath,
14             scraper => scraper {
15             col 1 => 'model', 'TEXT';
16             col 2 => 'sappli', [ 'TEXT', \&_marubatsu ];
17             col 3 => 'mobile_widget', [ 'TEXT', \&_marubatsu ];
18             # col 4 => 'flashlite' => [
19             # 'TEXT',
20             # sub { s/^Flash Lite\N{TRADE MARK SIGN}// },
21             # sub { s/\s// },
22             # sub { $_ = undef if /\N{MULTIPLICATION SIGN}/ }, # `x' case.
23             # ];
24             col 4 => 'gps_basic', [ 'TEXT', \&_marubatsu ];
25             col 5 => 'gps_agps', [ 'TEXT', \&_marubatsu ];
26             col 6 => 'felica', [ 'TEXT', \&_marubatsu ];
27             col 7 => 'pc_browser', [ 'TEXT', \&_marubatsu ];
28             },
29             );
30              
31 0 0   0     sub _marubatsu { $_ = $_ =~ /\N{WHITE CIRCLE}|\N{BULLSEYE}/ ? 1 : 0 }
32              
33             1;
34             __END__