File Coverage

blib/lib/Duadua/Parser/Bot/Baiduspider.pm
Criterion Covered Total %
statement 13 13 100.0
branch 5 6 83.3
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::Baiduspider;
2 11     11   72 use strict;
  11         21  
  11         405  
3 11     11   51 use warnings;
  11         32  
  11         2684  
4              
5             sub try {
6 232     232 1 620 my ($class, $d) = @_;
7              
8 232 100       562 if ( $d->_contain('Baiduspider') ) {
9 5         26 my $h = {
10             name => 'Baiduspider',
11             is_bot => 1,
12             };
13              
14 5 100       19 if ($d->opt_version) {
15 2         9 my ($version) = ($d->ua =~ m!Baiduspider(?:-render)?/([\d.]+)!);
16 2 50       13 $h->{version} = $version if $version;
17             }
18              
19 5         24 return $h;
20             }
21             }
22              
23             1;
24              
25             __END__