File Coverage

blib/lib/Duadua/Parser/Bot/BotMisc.pm
Criterion Covered Total %
statement 66 66 100.0
branch 64 74 86.4
condition 4 6 66.6
subroutine 4 4 100.0
pod 1 1 100.0
total 139 151 92.0


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::BotMisc;
2 11     11   68 use strict;
  11         26  
  11         452  
3 11     11   50 use warnings;
  11         223  
  11         563  
4 11     11   54 use Duadua::Util;
  11         20  
  11         14681  
5              
6             sub try {
7 181     181 1 365 my ($class, $d) = @_;
8              
9 181         279 my $h;
10              
11 181 100 66     463 if ( $d->ua eq 'ia_archiver' ) {
    100 66        
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
    100          
12 1         6 $h = {
13             name => 'Internet Archive',
14             is_bot => 1,
15             };
16             }
17             elsif ( $d->_contain('Yeti/')
18             && $d->_contain('+http://') && $d->_contain('naver.') ) {
19 4         16 $h = {
20             name => 'Naver Yeti',
21             is_bot => 1,
22             };
23              
24 4 100       10 if ($d->opt_version) {
25 2         7 my ($version) = ($d->ua =~ m!Yeti/([\d.]+)!);
26 2 50       10 $h->{version} = $version if $version;
27             }
28             }
29             elsif ( $d->_contain(' proximic;') ) {
30 2         13 $h = {
31             name => 'Comscore crawler',
32             is_bot => 1,
33             };
34             }
35             elsif ( $d->_contain(' Daum/') ) {
36 4         24 $h = {
37             name => 'Daum',
38             is_bot => 1,
39             };
40              
41 4 100       15 if ($d->opt_version) {
42 2         9 my ($version) = ($d->ua =~ m! Daum/([\d.]+)!);
43 2 50       13 $h->{version} = $version if $version;
44             }
45              
46 4         18 $h = Duadua::Util->set_os($d, $h);
47             }
48             elsif ( $d->_contain('MixnodeCache/') ) {
49 2         11 $h = {
50             name => 'mixnode.com',
51             is_bot => 1,
52             };
53              
54 2 100       9 if ($d->opt_version) {
55 1         5 my ($version) = ($d->ua =~ m!^MixnodeCache/([\d.]+)!);
56 1 50       8 $h->{version} = $version if $version;
57             }
58             }
59             elsif ( $d->_contain('SearchAtlas.com ') ) {
60 1         6 $h = {
61             name => 'SearchAtlas.com',
62             is_bot => 1,
63             };
64             }
65             elsif ( $d->_contain('ltx71') ) {
66 1         5 $h = {
67             name => 'ltx71',
68             is_bot => 1,
69             };
70             }
71             elsif ( $d->ua eq 'The Knowledge AI' ) {
72 1         7 $h = {
73             name => 'The Knowledge AI',
74             is_bot => 1,
75             };
76             }
77             elsif ( $d->_contain(' FlipboardProxy/') ) {
78 2         10 $h = {
79             name => 'FlipboardProxy',
80             is_bot => 1,
81             };
82              
83 2 100       7 if ($d->opt_version) {
84 1         5 my ($version) = ($d->ua =~ m! FlipboardProxy/([\d.]+)!);
85 1 50       9 $h->{version} = $version if $version;
86             }
87             }
88             elsif ( $d->_contain(' BuiltWith/') ) {
89 2         12 $h = {
90             name => 'BuiltWith',
91             is_bot => 1,
92             };
93              
94 2 100       7 if ($d->opt_version) {
95 1         5 my ($version) = ($d->ua =~ m! BuiltWith/([\d.]+)!);
96 1 50       7 $h->{version} = $version if $version;
97             }
98              
99 2         11 $h = Duadua::Util->set_os($d, $h);
100             }
101             elsif ( $d->_contain(' zgrab/') ) {
102 2         10 $h = {
103             name => 'ZGrab',
104             is_bot => 1,
105             };
106              
107 2 100       10 if ($d->opt_version) {
108 1         3 my ($version) = ($d->ua =~ m! zgrab/([\d.x]+)!);
109 1 50       8 $h->{version} = $version if $version;
110             }
111              
112 2         10 $h = Duadua::Util->set_os($d, $h);
113             }
114             elsif ( $d->_contain(' RyowlEngine/') ) {
115 2         12 $h = {
116             name => 'RyowlEngine',
117             is_bot => 1,
118             };
119              
120 2 100       9 if ($d->opt_version) {
121 1         5 my ($version) = ($d->ua =~ m! RyowlEngine/([\d.]+)!);
122 1 50       7 $h->{version} = $version if $version;
123             }
124              
125 2         10 $h = Duadua::Util->set_os($d, $h);
126             }
127             elsif ( $d->_contain(' DataXu/') ) {
128 2         11 $h = {
129             name => 'DataXu',
130             is_bot => 1,
131             };
132              
133 2 100       7 if ($d->opt_version) {
134 1         6 my ($version) = ($d->ua =~ m! DataXu/([\d.]+)!);
135 1 50       7 $h->{version} = $version if $version;
136             }
137              
138 2         9 $h = Duadua::Util->set_os($d, $h);
139             }
140             elsif ( $d->_contain('istellabot/') ) {
141 2         12 $h = {
142             name => 'istellabot',
143             is_bot => 1,
144             };
145              
146 2 100       9 if ($d->opt_version) {
147 1         4 my ($version) = ($d->ua =~ m!^istellabot/([t\d.]+)!);
148 1 50       8 $h->{version} = $version if $version;
149             }
150              
151 2         11 $h = Duadua::Util->set_os($d, $h);
152             }
153             elsif ( $d->_contain(' Cincraw/') ) {
154 2         10 $h = {
155             name => 'Cincraw',
156             is_bot => 1,
157             };
158              
159 2 100       7 if ($d->opt_version) {
160 1         6 my ($version) = ($d->ua =~ m! Cincraw/([\d.]+)!);
161 1 50       6 $h->{version} = $version if $version;
162             }
163             }
164             elsif ( $d->_contain('KOCMOHABT ') ) {
165 2         12 $h = {
166             name => 'KOCMOHABT',
167             is_bot => 1,
168             };
169             }
170             elsif ( $d->_contain('Hexometer') ) {
171 1         7 $h = {
172             name => 'Hexometer',
173             is_bot => 1,
174             };
175             }
176              
177 181         773 return $h;
178             }
179              
180             1;
181              
182             __END__