line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Duadua::Parser::Bot::GooglebotMisc; |
2
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
161
|
|
3
|
6
|
|
|
6
|
|
24
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
2678
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub try { |
6
|
194
|
|
|
194
|
1
|
382
|
my ($class, $d) = @_; |
7
|
|
|
|
|
|
|
|
8
|
194
|
100
|
|
|
|
523
|
return unless index($d->ua, 'Google') > -1; |
9
|
|
|
|
|
|
|
|
10
|
17
|
100
|
|
|
|
46
|
if ( index($d->ua, 'Googlebot-Image') > -1 ) { |
11
|
2
|
|
|
|
|
8
|
my $h = { |
12
|
|
|
|
|
|
|
name => 'Googlebot-Image', |
13
|
|
|
|
|
|
|
is_bot => 1, |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
2
|
100
|
|
|
|
6
|
if ($d->opt_version) { |
17
|
1
|
|
|
|
|
6
|
my ($version) = ($d->ua =~ m!^Googlebot-Image/([\d.]+)!); |
18
|
1
|
50
|
|
|
|
6
|
$h->{version} = $version if $version; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
9
|
return $h; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
15
|
100
|
|
|
|
36
|
if ( index($d->ua, 'Googlebot-News') > -1 ) { |
25
|
|
|
|
|
|
|
return { |
26
|
1
|
|
|
|
|
7
|
name => 'Googlebot-News', |
27
|
|
|
|
|
|
|
is_bot => 1, |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
14
|
100
|
|
|
|
32
|
if ( index($d->ua, 'Googlebot-Video') > -1 ) { |
32
|
2
|
|
|
|
|
7
|
my $h = { |
33
|
|
|
|
|
|
|
name => 'Googlebot-Video', |
34
|
|
|
|
|
|
|
is_bot => 1, |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
2
|
100
|
|
|
|
6
|
if ($d->opt_version) { |
38
|
1
|
|
|
|
|
4
|
my ($version) = ($d->ua =~ m!^Googlebot-Video/([\d.]+)!); |
39
|
1
|
50
|
|
|
|
6
|
$h->{version} = $version if $version; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
7
|
return $h; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
12
|
100
|
|
|
|
120
|
if ( index($d->ua, 'FeedFetcher-Google') == 0 ) { |
46
|
|
|
|
|
|
|
return { |
47
|
1
|
|
|
|
|
5
|
name => 'FeedFetcher-Google', |
48
|
|
|
|
|
|
|
is_bot => 1, |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
11
|
100
|
100
|
|
|
77
|
if ( index($d->ua, ' AppEngine-Google;') > -1 || index($d->ua, 'AppEngine-Google; ') > -1 ) { |
53
|
|
|
|
|
|
|
return { |
54
|
2
|
|
|
|
|
10
|
name => 'AppEngine-Google', |
55
|
|
|
|
|
|
|
is_bot => 1, |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
9
|
100
|
|
|
|
26
|
if ( index($d->ua, ' Google-Site-Verification') > -1 ) { |
60
|
2
|
|
|
|
|
8
|
my $h = { |
61
|
|
|
|
|
|
|
name => 'Google-Site-Verification', |
62
|
|
|
|
|
|
|
is_bot => 1, |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
|
65
|
2
|
100
|
|
|
|
6
|
if ($d->opt_version) { |
66
|
1
|
|
|
|
|
10
|
my ($version) = ($d->ua =~ m! Google-Site-Verification/([\d.]+)!); |
67
|
1
|
50
|
|
|
|
6
|
$h->{version} = $version if $version; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
2
|
|
|
|
|
8
|
return $h; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
7
|
100
|
|
|
|
25
|
if ( index($d->ua, ' Google Page Speed Insights') > -1 ) { |
74
|
1
|
|
|
|
|
6
|
my $h = { |
75
|
|
|
|
|
|
|
name => 'Google Page Speed Insights', |
76
|
|
|
|
|
|
|
is_bot => 1, |
77
|
|
|
|
|
|
|
}; |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
5
|
return Duadua::Util->set_os($d, $h); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |