File Coverage

blib/lib/Duadua/Parser/Bot/GooglebotAd.pm
Criterion Covered Total %
statement 16 16 100.0
branch 6 6 100.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 27 27 100.0


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::GooglebotAd;
2 6     6   960 use strict;
  6         11  
  6         171  
3 6     6   28 use warnings;
  6         11  
  6         130  
4 6     6   31 use Duadua::Util;
  6         11  
  6         836  
5              
6             sub try {
7 340     340 1 607 my ($class, $d) = @_;
8              
9 340 100       628 return unless index($d->ua, 'Google') > -1;
10              
11 22 100       66 if ( index($d->ua, 'Mediapartners-Google') > -1 ) {
12 3         12 my $h = {
13             name => 'Mediapartners-Google',
14             is_bot => 1,
15             };
16              
17 3         12 return Duadua::Util->set_os($d, $h);
18             }
19              
20 19 100       58 if ( index($d->ua, 'AdsBot-Google') > -1 ) {
21             return {
22 1         13 name => 'AdsBot-Google',
23             is_bot => 1,
24             };
25             }
26             }
27              
28             1;
29              
30             __END__