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   740 use strict;
  6         12  
  6         155  
3 6     6   26 use warnings;
  6         7  
  6         133  
4 6     6   26 use Duadua::Util;
  6         10  
  6         691  
5              
6             sub try {
7 339     339 1 731 my ($class, $d) = @_;
8              
9 339 100       717 return unless index($d->ua, 'Google') > -1;
10              
11 22 100       59 if ( index($d->ua, 'Mediapartners-Google') > -1 ) {
12 3         20 my $h = {
13             name => 'Mediapartners-Google',
14             is_bot => 1,
15             };
16              
17 3         16 return Duadua::Util->set_os($d, $h);
18             }
19              
20 19 100       41 if ( index($d->ua, 'AdsBot-Google') > -1 ) {
21             return {
22 1         6 name => 'AdsBot-Google',
23             is_bot => 1,
24             };
25             }
26             }
27              
28             1;
29              
30             __END__