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