line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Duadua::Parser::Bot::BingPreview; |
2
|
6
|
|
|
6
|
|
36
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
153
|
|
3
|
6
|
|
|
6
|
|
29
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
1330
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub try { |
6
|
321
|
|
|
321
|
1
|
652
|
my ($class, $d) = @_; |
7
|
|
|
|
|
|
|
|
8
|
321
|
100
|
66
|
|
|
641
|
if ( index($d->ua, 'BingPreview/') > -1 |
9
|
|
|
|
|
|
|
&& index($d->ua, 'Mozilla/') > -1 ) { |
10
|
4
|
|
|
|
|
10
|
my $h = _set_property($d, 'BingPreview'); |
11
|
|
|
|
|
|
|
|
12
|
4
|
100
|
|
|
|
13
|
if ($d->opt_version) { |
13
|
2
|
|
|
|
|
6
|
my ($version) = ($d->ua =~ m!BingPreview/([\d.a-z]+)!); |
14
|
2
|
50
|
|
|
|
8
|
$h->{version} = $version if $version; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
37
|
return $h; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _set_property { |
22
|
4
|
|
|
4
|
|
10
|
my ($d, $name) = @_; |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
14
|
my $h = { |
25
|
|
|
|
|
|
|
name => $name, |
26
|
|
|
|
|
|
|
is_bot => 1, |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
4
|
50
|
|
|
|
11
|
if ( index($d->ua, 'Windows') > -1 ) { |
30
|
4
|
|
|
|
|
9
|
$h->{is_windows} = 1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
9
|
return $h; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |