line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Duadua::Parser::Bot::DuckDuckBot; |
2
|
6
|
|
|
6
|
|
716
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
175
|
|
3
|
6
|
|
|
6
|
|
28
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
169
|
|
4
|
6
|
|
|
6
|
|
28
|
use Duadua::Util; |
|
6
|
|
|
|
|
19
|
|
|
6
|
|
|
|
|
995
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub try { |
7
|
183
|
|
|
183
|
1
|
348
|
my ($class, $d) = @_; |
8
|
|
|
|
|
|
|
|
9
|
183
|
100
|
100
|
|
|
386
|
if ( index($d->ua, 'DuckDuck') > -1 && index($d->ua, '://duckduckgo.com') > -1) { |
10
|
6
|
|
|
|
|
17
|
my $h = { |
11
|
|
|
|
|
|
|
name => 'DuckDuckGo Bot', |
12
|
|
|
|
|
|
|
is_bot => 1, |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
6
|
100
|
|
|
|
14
|
if ($d->opt_version) { |
16
|
3
|
|
|
|
|
6
|
my ($version) = ($d->ua =~ m!DuckDuck[^/]+/([\d.]+);!); |
17
|
3
|
50
|
|
|
|
11
|
$h->{version} = $version if $version; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
6
|
|
|
|
|
23
|
return $h; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |