line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Duadua::Parser::Bot::AdIdxBot; |
2
|
6
|
|
|
6
|
|
923
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
169
|
|
3
|
6
|
|
|
6
|
|
30
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
1811
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub try { |
6
|
328
|
|
|
328
|
1
|
577
|
my ($class, $d) = @_; |
7
|
|
|
|
|
|
|
|
8
|
328
|
50
|
66
|
|
|
597
|
if ( index($d->ua, 'adidxbot/') > -1 |
|
|
|
66
|
|
|
|
|
9
|
|
|
|
|
|
|
&& index($d->ua, '+http://www.bing.com/bingbot.htm') > -1 |
10
|
|
|
|
|
|
|
&& index($d->ua, 'Mozilla/') > -1 ) { |
11
|
6
|
|
|
|
|
16
|
my $h = _set_property($d, 'AdIdxBot'); |
12
|
|
|
|
|
|
|
|
13
|
6
|
100
|
|
|
|
15
|
if ($d->opt_version) { |
14
|
3
|
|
|
|
|
11
|
my ($version) = ($d->ua =~ m!adidxbot/([\d.]+)!); |
15
|
3
|
50
|
|
|
|
16
|
$h->{version} = $version if $version; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
27
|
return $h; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _set_property { |
23
|
6
|
|
|
6
|
|
15
|
my ($d, $name) = @_; |
24
|
|
|
|
|
|
|
|
25
|
6
|
|
|
|
|
19
|
my $h = { |
26
|
|
|
|
|
|
|
name => $name, |
27
|
|
|
|
|
|
|
is_bot => 1, |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
6
|
100
|
|
|
|
14
|
if ( index($d->ua, 'Windows') > -1 ) { |
|
|
100
|
|
|
|
|
|
31
|
2
|
|
|
|
|
17
|
$h->{is_windows} = 1; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
elsif ( index($d->ua, 'iPhone') > -1 ) { |
34
|
2
|
|
|
|
|
6
|
$h->{is_ios} = 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
6
|
|
|
|
|
14
|
return $h; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |