blib/lib/WWW/Wappalyzer.pm

filter: Statementstmt 100% 174 / 174 Branchbran 88.0% 81 / 92 Conditioncond 91.1% 31 / 34 MC/DCmcdc 78.9% 15 / 19 Subroutinesub 94.1% 16 / 17 Podpod 100% 3 / 3 totaltotal 94.4% 320 / 339 SCAR 42.6
CC
70
Cov
95%
detect
37.2
_load_categories
12.8
_process_app_clues
12.0
CRAP 70.5
↑ Summary
1 package WWW::Wappalyzer;
2  
3 3 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use base qw ( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 our @EXPORT_OK = qw( detect get_categories add_clues_file );
9  
10 3 ▶use lib::abs;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use JSON qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Regexp::Parser;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 3 my %_categories;
15 3 my @_clues_file_list = ( lib::abs::path( './apps.json' ) );
16  
17 # List of multi per web page application categories
18 3 my %MULTIPLE_APP_CATS = map { $_ => 1 } qw(
19 widgets analytics javascript-frameworks video-players
20 font-scripts miscellaneous advertising-networks payment-processors
21 );
22  
23 =head1 NAME
24  
25 WWW::Wappalyzer - Perl port of Wappalyzer (http://wappalyzer.com)
26  
27 =head1 DESCRIPTION
28  
29 Uncovers the technologies used on websites: detects content management systems, web shops,
30 web servers, JavaScript frameworks, analytics tools and many more.
31  
32 Lacks 'version', 'implies', 'excludes' support of original Wappalyzer in favour of speed.
33  
34 Clues: L<https://github.com/AliasIO/Wappalyzer/blob/master/src/apps.json>
35  
36 More info on Wappalyzer: L<https://github.com/AliasIO/Wappalyzer>
37  
38 =cut
39  
40 3 our $VERSION = '0.20';
41  
42 =head1 SYNOPSIS
43  
44 use WWW::Wappalyzer;
45 use LWP::UserAgent;
46  
47 my $response = LWP::UserAgent->new->get( 'http://www.drupal.org' );
48 my %detected = WWW::Wappalyzer::detect(
49 html => $response->decoded_content,
50 headers => $response->headers,
51 );
52  
53 # %detected = (
54 # 'web-servers' => [ 'Apache' ],
55 # 'cms' => [ 'Drupal' ],
56 # 'cache-tools' => [ 'Varnish' ],
57 # 'analytics' => [ 'Google Analytics' ],
58 # 'operating-systems' => [ 'CentOS' ]
59 # );
60  
61 =head1 EXPORT
62  
63 None by default.
64  
65 =head1 SUBROUTINES/METHODS
66  
67 =head2 detect
68  
69 my %detected = detect( %params )
70  
71 Tries to detect CMS, framework, etc for given html code, http headers, url.
72  
73 Available parameters:
74  
75 html - html code of web page
76 headers - hash ref to http headers list
77 url - url of web page
78 cats - array ref to a list of trying categories, defaults to all categories;
79 less cats => less cpu usage
80  
81 Returns the hash of detected applications by categorie:
82  
83 (
84 cms => [ 'Joomla' ],
85 'javascript-frameworks' => [ 'jQuery', 'jQuery UI' ],
86 )
87  
88 =cut
89  
90 sub detect {
91 9 ▶ my %params = @_;
Subroutine detect: called CC=37 SCAR=36.2
Pod documented
92  
93 9 ▶ return () unless $params{html} || $params{headers} || $params{url};
Branch: 1 branch
BranchTrueFalseTotal
unless $params{"html"} or $params{"headers"} or $params{"url"} 0 9 9
Condition83%5/6
$params{"html"} or $params{"headers"} or $params{"url"}
l!l&&r!l&&!r
810
$params{"html"} or $params{"headers"}
l!l&&r!l&&!r
711
MC/DC0%0/3
$params{"html"} or $params{"headers"} or $params{"url"}
$params{"html"} $params{"headers"} $params{"url"}
Truth table75%3/4
A or B or C
A= $params{"html"}B= $params{"headers"}C= $params{"url"}
ABCresult
1XX1
01X1
0011
0000
94
95 # search will be case insensitive
96 9 ▶ if ( $params{html} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"html"}) 7 2 9
97 7 $params{html} = lc $params{html};
98 }
99 9 ▶ if ( $params{url} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"url"}) 1 8 9
100 1 $params{url} = lc $params{url};
101 }
102 9 ▶ if ( $params{headers} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"headers"}) 5 4 9
103 # do not modify orig headers
104 5 my %tmp;
105 5 $tmp{$_} = lc $params{headers}{$_} for keys %{ $params{headers} };
106 5 $params{headers} = \%tmp;
107 }
108  
109 # Lazy load and process clues from JSON file
110 9 ▶ _load_categories() unless scalar keys %_categories;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar keys %_categories 1 8 9
111  
112 my @cats = $params{cats} && ( ref( $params{cats} ) || '' ) eq 'ARRAY'
113 9 ▶ ? @{ $params{cats} } : get_categories();
Branch: 1 branch
BranchTrueFalseTotal
$params{'cats'} && (ref $params{'cats'} || '') eq 'ARRAY' ? : 2 7 9
Condition60%3/5
$params{"cats"} and (ref $params{"cats"} || "") eq "ARRAY"
!ll&&!rl&&r
702
ref $params{'cats'} || ''
l!l
20
MC/DC50%1/2
$params{"cats"} and (ref $params{"cats"} || "") eq "ARRAY"
$params{"cats"} ref $params{'cats'}
Truth table66%2/3
A and B
A= $params{"cats"}B= ref $params{'cats'}
ABresult
0X0
100
111
114  
115 9 my $headers_ref;
116 9 ▶ if ( $params{headers} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"headers"}) 5 4 9
117 # make all headers name lowercase
118 5 ▶ while ( my ( $name, $value ) = each %{ $params{headers} } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$params{"headers"};}) 6 5 11
119 6 $headers_ref->{ lc $name } = $value;
120 }
121 }
122  
123 9 my %detected;
124 my %tried_multi_cat_apps;
125 9 for my $cat ( @cats ) {
126 363 ▶ my $apps_ref = $_categories{ $cat } or die "Unknown categorie $cat";
Branch: 1 branch
BranchTrueFalseTotal
my $apps_ref = $_categories{$cat} or die "Unknown categorie $cat" 0 363 363
127  
128 APP:
129 363 for my $app_ref ( @$apps_ref ) {
130  
131 6250 my $detected;
132  
133 # Some speed optimizations
134 6250 ▶ if ( @cats > 1 && $app_ref->{multi_cat}
Branch: 1 branch
BranchTrueFalseTotal
if (@cats > 1 and $app_ref->{'multi_cat'} and exists $tried_multi_cat_apps{$app_ref->{'name'}}) { } 505 5745 6250
Condition100%6/6
@cats > 1 and $app_ref->{"multi_cat"} and exists $tried_multi_cat_apps{$app_ref->{"name"}}
!ll&&!rl&&r
5290455505
@cats > 1 and $app_ref->{"multi_cat"}
!ll&&!rl&&r
1135177960
MC/DC100%3/3
@cats > 1 and $app_ref->{"multi_cat"} and exists $tried_multi_cat_apps{$app_ref->{"name"}}
@cats > 1 $app_ref->{"multi_cat"} exists $tried_multi_cat_apps{$app_ref->{"name"}}
Truth table100%4/4
A and B and C
A= @cats > 1B= $app_ref->{"multi_cat"}C= exists $tried_multi_cat_apps{$app_ref->{"name"}}
ABCresult
0XX0
10X0
1100
1111
135 && exists $tried_multi_cat_apps{ $app_ref->{name} }
136 ) {
137 505 $detected = $tried_multi_cat_apps{ $app_ref->{name} };
138 }
139 else {
140 # Try regexes...
141 5745 my $confidence = 0;
142  
143 5745 ▶ if ( defined $headers_ref && exists $app_ref->{headers_rules} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $headers_ref and exists $app_ref->{"headers_rules"}) 1102 4643 5745
Condition100%3/3
defined $headers_ref and exists $app_ref->{"headers_rules"}
!ll&&!rl&&r
254420991102
MC/DC100%2/2
defined $headers_ref and exists $app_ref->{"headers_rules"}
defined $headers_ref exists $app_ref->{"headers_rules"}
Truth table100%3/3
A and B
A= defined $headers_refB= exists $app_ref->{"headers_rules"}
ABresult
0X0
100
111
144 1102 my %headers_rules = %{ $app_ref->{headers_rules} };
145 1102 ▶ while ( my ( $header, $rule ) = each %headers_rules ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %headers_rules) 1300 1096 2396
146 1300 ▶ my $header_val = $headers_ref->{ $header } or next;
Branch: 1 branch
BranchTrueFalseTotal
my $header_val = $headers_ref->{$header} or next 723 577 1300
147  
148 577 ▶ if ( $header_val =~ m/$rule->{re}/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($header_val =~ /$rule->{"re"}/) 6 571 577
149 6 $confidence += $rule->{confidence};
150 6 ▶ if ( $confidence >= 100 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($confidence >= 100) 6 0 6
151 6 $detected = 1;
152 6 last;
153 }
154 }
155 }
156 }
157  
158 5745 ▶ unless ( $detected ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($detected) 5739 6 5745
159 # try from most to least relevant method
160 RULES:
161 5739 for my $rule_type ( qw( html url ) ) {
162 11472 my $rule_name = $rule_type. '_rules';
163 11472 ▶ if ( defined $params{ $rule_type } && exists $app_ref->{ $rule_name } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $params{$rule_type} and exists $app_ref->{$rule_name}) 3293 8179 11472
Condition100%3/3
defined $params{$rule_type} and exists $app_ref->{$rule_name}
!ll&&!rl&&r
583523443293
MC/DC100%2/2
defined $params{$rule_type} and exists $app_ref->{$rule_name}
defined $params{$rule_type} exists $app_ref->{$rule_name}
Truth table100%3/3
A and B
A= defined $params{$rule_type}B= exists $app_ref->{$rule_name}
ABresult
0X0
100
111
164 3293 for my $rule ( @{ $app_ref->{ $rule_name } } ) {
165 3410 ▶ if ( $params{ $rule_type } =~ m/$rule->{re}/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{$rule_type} =~ /$rule->{"re"}/) 9 3401 3410
166 9 $confidence += $rule->{confidence};
167 9 ▶ if ( $confidence >= 100 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($confidence >= 100) 7 2 9
168 7 $detected = 1;
169 7 last RULES;
170 }
171 }
172 }
173 }
174 }
175 }
176  
177 # Some speed optimizations
178 5745 ▶ if ( @cats > 1 && $app_ref->{multi_cat} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@cats > 1 and $app_ref->{"multi_cat"}) 455 5290 5745
Condition100%3/3
@cats > 1 and $app_ref->{"multi_cat"}
!ll&&!rl&&r
1135177455
MC/DC100%2/2
@cats > 1 and $app_ref->{"multi_cat"}
@cats > 1 $app_ref->{"multi_cat"}
Truth table100%3/3
A and B
A= @cats > 1B= $app_ref->{"multi_cat"}
ABresult
0X0
100
111
179 455 $tried_multi_cat_apps{ $app_ref->{name} } = $detected;
180 }
181 }
182  
183 6250 ▶ next unless $detected;
Branch: 1 branch
BranchTrueFalseTotal
unless $detected 6237 13 6250
184  
185 # Detected!
186 13 push @{ $detected{ $cat } }, $app_ref->{name};
187  
188 13 ▶ last APP unless $MULTIPLE_APP_CATS{ $cat };
Branch: 1 branch
BranchTrueFalseTotal
unless $MULTIPLE_APP_CATS{$cat} 12 1 13
189 }
190 }
191  
192 9 return %detected;
193 }
194  
195 =head2 get_categories
196  
197 my @cats = get_categories()
198  
199 Returns the array of all application categories.
200  
201 =cut
202  
203 sub get_categories {
204 # Lazy load and process clues from JSON files
205 8 ▶ _load_categories() unless scalar keys %_categories;
Subroutine get_categories: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
unless scalar keys %_categories 1 7 8
206  
207 8 return keys %_categories;
208 }
209  
210 # Loads and processes clues from JSON files
211 sub _load_categories {
212  
213 2 ▶ for my $clue_file ( @_clues_file_list ) {
Subroutine _load_categories: called CC=12 SCAR=25.5
214 3 ▶ open my $fh, '<', $clue_file
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $clue_file or die "Can not read clues file $clue_file." 0 3 3
215 or die "Can not read clues file $clue_file.";
216  
217 3 local $/ = undef;
218 3 my $json = <$fh>;
219 3 close $fh;
220  
221 # Replace html entities with oridinary symbols
222 3 $json =~ s{&gt;}{>}xig;
223 3 $json =~ s{&lt;}{<}xig;
224  
225 3 my $cfg_ref = eval { JSON::decode_json( $json ) };
226  
227 3 ▶ die "Can't parse clue file $clue_file: $@" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 3 3
228  
229 my $cats_ref = $cfg_ref->{categories}
230 3 ▶ or die "Broken clues file $clue_file. Can not find categories.";
Branch: 1 branch
BranchTrueFalseTotal
my $cats_ref = $cfg_ref->{"categories"} or die "Broken clues file $clue_file. Can not find categories." 0 3 3
231  
232 my $apps_ref = $cfg_ref->{apps}
233 3 ▶ or die "Broken clues file $clue_file. Can not find applications.";
Branch: 1 branch
BranchTrueFalseTotal
my $apps_ref = $cfg_ref->{"apps"} or die "Broken clues file $clue_file. Can not find applications." 0 3 3
234  
235 # Process apps
236 3 ▶ while ( my ( $app, $app_ref ) = each %$apps_ref ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$apps_ref) 1695 3 1698
237  
238 1695 ▶ my $new_app_ref = _process_app_clues( $app, $app_ref ) or next;
Branch: 1 branch
BranchTrueFalseTotal
my $new_app_ref = _process_app_clues($app, $app_ref) or next 0 1695 1695
239  
240 1695 ▶ my @cats = @{ $app_ref->{cats} } or next;
Branch: 1 branch
BranchTrueFalseTotal
my(@cats) = @{$app_ref->{"cats"};} or next 0 1695 1695
241  
242 1695 ▶ $new_app_ref->{multi_cat} = 1 if @cats > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @cats > 1 130 1565 1695
243  
244 1695 for my $cat_id ( @cats ) {
245 1855 ▶ my $cat = $cats_ref->{ $cat_id } or next;
Branch: 1 branch
BranchTrueFalseTotal
my $cat = $cats_ref->{$cat_id} or next 0 1855 1855
246  
247 1855 push @{ $_categories{ $cat } }, $new_app_ref;
248 }
249 }
250 }
251 }
252  
253 # Process clues of given app
254 sub _process_app_clues {
255 1695 ▶ my ( $app, $app_ref ) = @_;
Subroutine _process_app_clues: called CC=12 SCAR=24.8
256  
257 1695 my $new_app_ref = { name => $app };
258  
259 1695 my @fields = grep { exists $app_ref->{$_} } qw( script html meta headers url );
260 1695 my @html_rules;
261 # Precompile regexps
262 1695 for my $field ( @fields ) {
263 2113 my $rule_ref = $app_ref->{ $field };
264 my @rules_list = !ref $rule_ref ? _parse_rule( $rule_ref )
265 2113 ▶ : ref $rule_ref eq 'ARRAY' ? ( map { _parse_rule( $_ ) } @$rule_ref )
Branch: 2 branches
BranchTrueFalseTotal
!ref($rule_ref) ? : 1052 1061 2113
ref $rule_ref eq 'ARRAY' ? : 90 971 1061
266 : () ;
267  
268 2113 ▶ if ( $field eq 'html' ) {
Branch: 5 branches
BranchTrueFalseTotal
if ($field eq 'html') { } 523 1590 2113
elsif ($field eq 'script') { } 547 1043 1590
elsif ($field eq 'url') { } 72 971 1043
elsif ($field eq 'meta') { } 365 606 971
elsif ($field eq 'headers') { } 606 0 606
269 523 push @html_rules, map { $_->{re} = qr/(?-x:$_->{re})/; $_ } @rules_list;
270 }
271 elsif ( $field eq 'script' ) {
272 push @html_rules,
273 map {
274 547 $_->{re} = qr/
275 < \s* script [^>]+ src \s* = \s* ["'] [^"']* (?-x:$_->{re}) [^"']* ["']
276 /x;
277 599 $_
278 } @rules_list;
279 }
280 elsif ( $field eq 'url' ) {
281 72 my @url_rules = map { $_->{re} = qr/(?-x:$_->{re})/; $_ } @rules_list;
282 72 $new_app_ref->{url_rules} = _optimize_rules( \@url_rules );
283 }
284 elsif ( $field eq 'meta' ) {
285 365 for my $key ( keys %$rule_ref ) {
286 397 my $lc_key = lc $key;
287 397 my $name_re = qr/ name \s* = \s* ["']? $lc_key ["']? /x;
288 397 my $rule = _parse_rule( $rule_ref->{$key} );
289 397 $rule->{re} = qr/$rule->{re}/;
290 397 my $content_re = qr/ content \s* = \s* ["'] [^"']* (?-x:$rule->{re}) [^"']* ["'] /x;
291  
292 397 $rule->{re} = qr/
293 < \s* meta \s+
294 (?:
295 (?: $name_re \s+ $content_re )
296 # | (?: $content_re \s+ $name_re ) # hangs sometimes
297 )
298 /x;
299
300 397 push @html_rules, $rule;
301 }
302 }
303 elsif ( $field eq 'headers' ) {
304 606 for my $key ( keys %$rule_ref ) {
305 714 my $rule = _parse_rule( $rule_ref->{$key} );
306 714 $rule->{re} = qr/$rule->{re}/;
307 714 $new_app_ref->{headers_rules}{ lc $key } = $rule;
308 }
309 }
310 }
311  
312 1695 ▶ if ( @html_rules ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@html_rules) 1121 574 1695
313 1121 $new_app_ref->{html_rules} = _optimize_rules( \@html_rules );
314 }
315  
316 1695 return $new_app_ref;
317 }
318  
319 # separate regexp and other optional parameters from the rule
320 sub _parse_rule {
321 2349 ▶ my ( $rule ) = @_;
Subroutine _parse_rule: called CC=5 SCAR=16.1
322
323 2349 my ( $re, @params ) = split /\\;/, $rule;
324
325 2349 my $confidence;
326 2349 for my $param ( @params ) {
327 628 ▶ if ( ( $confidence ) = $param =~ /^\s*confidence\s*:\s*(\d+)\s*$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (($confidence) = $param =~ /^\s*confidence\s*:\s*(\d+)\s*$/) 58 570 628
328 # supports only confidence for now
329 58 last;
330 }
331 }
332
333 return {
334 2349 ▶ re => _escape_re( defined( $re ) ? $re : '' ),
Branch: 1 branch
BranchTrueFalseTotal
defined $re ? : 2273 76 2349
Condition100%2/2
$confidence || 100
l!l
582291
MC/DC100%1/1
$confidence || 100
$confidence
Truth table100%2/2
A
A= $confidence
Aresult
11
00
335 confidence => $confidence || 100,
336 };
337 }
338  
339 # Escape special symbols in regexp string of config file
340 sub _escape_re {
341 2349 ▶ my ( $re ) = @_;
Subroutine _escape_re: called CC=5 SCAR=16.1
342
343 # Escape { } braces
344 #$re =~ s/ ([{}]) /[$1]/xig;
345  
346 # Escape [^]
347 2349 $re =~ s{\Q[^]\E}{[\\^]}ig;
348  
349 # Escape \\1
350 2349 $re =~ s{\Q\1\E}{\\\\1}ig;
351  
352 # Escape (?!
353 2349 $re =~ s{[(][?][!]}{([?]!}ig;
354
355 # turn literals in regexp to lowercase to make case insensitive search
356 # i flag will be slower because we makes many searches in one text
357 3 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
358 2349 ▶ local *Regexp::Parser::warn = sub {}; # it may be too noisy
Subroutine __ANON__: not called CC=1 SCAR=0.0
359
360 2349 my $parser = Regexp::Parser->new();
361 2349 ▶ if ( $parser->regex($re) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($parser->regex($re)) 2271 78 2349
362 2271 $re = '';
363
364 2271 ▶ while ( my $node = $parser->next ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $node = $parser->next) 55322 2271 57593
365 55322 my $ref = ref $node;
366 55322 ▶ if ( $ref eq 'Regexp::Parser::exact' || $ref eq 'Regexp::Parser::anyof_char' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ref eq 'Regexp::Parser::exact' or $ref eq 'Regexp::Parser::anyof_char') { } 45214 10108 55322
Condition100%3/3
$ref eq "Regexp::Parser::exact" or $ref eq "Regexp::Parser::anyof_char"
l!l&&r!l&&!r
43872134210108
MC/DC100%2/2
$ref eq "Regexp::Parser::exact" or $ref eq "Regexp::Parser::anyof_char"
$ref eq "Regexp::Parser::exact" $ref eq "Regexp::Parser::anyof_char"
Truth table100%3/3
A or B
A= $ref eq "Regexp::Parser::exact"B= $ref eq "Regexp::Parser::anyof_char"
ABresult
1X1
011
000
367 45214 $re .= lc $node->raw;
368 }
369 else {
370 10108 $re .= $node->raw;
371 }
372 }
373 }
374
375 2349 return $re;
376 }
377  
378 # If possible combine all rules in one regexp
379 sub _optimize_rules {
380 1193 ▶ my ( $rules ) = @_;
Subroutine _optimize_rules: called CC=3 SCAR=11.0
381
382 1193 ▶ if ( @$rules > 1 && @$rules == grep { $_->{confidence} == 100 } @$rules ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$rules > 1 and @$rules == grep({$_->{"confidence"} == 100;} @$rules)) 317 876 1193
Condition100%3/3
@$rules > 1 and @$rules == grep({$_->{"confidence"} == 100;} @$rules)
!ll&&!rl&&r
85125317
MC/DC100%2/2
@$rules > 1 and @$rules == grep({$_->{"confidence"} == 100;} @$rules)
@$rules > 1 @$rules == grep({$_->{"confidence"} == 100;} @$rules)
Truth table100%3/3
A and B
A= @$rules > 1B= @$rules == grep({$_->{"confidence"} == 100;} @$rules)
ABresult
0X0
100
111
383 # can combine only if confidence for each is 100
384 317 my $re = join '|', map { $_->{re} } @$rules;
385 return [{
386 317 re => qr/$re/,
387 confidence => 100,
388 }];
389 }
390
391 876 return $rules;
392 }
393  
394 =head2 add_clues_file
395  
396 add_clues_file( $filepath )
397  
398 Puts additional clues file to a list of processed clues files.
399 See apps.json as format sample.
400  
401 =cut
402  
403 sub add_clues_file {
404 1 ▶ my ( $filepath ) = @_;
Subroutine add_clues_file: called CC=1 SCAR=0.0
Pod documented
405  
406 1 push @_clues_file_list, $filepath;
407  
408 # just clear out categories to lazy load later
409 1 %_categories = ();
410 }
411  
412 =head1 AUTHOR
413  
414 Alexander Nalobin, C<< <alexander at nalobin.ru> >>
415  
416 =head1 BUGS
417  
418 Please report any bugs or feature requests to C<bug-www-wappalyzer at rt.cpan.org>, or through
419 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Wappalyzer>. I will be notified, and then you'll
420 automatically be notified of progress on your bug as I make changes.
421  
422  
423 =head1 SUPPORT
424  
425 You can find documentation for this module with the perldoc command.
426  
427 perldoc WWW::Wappalyzer
428  
429  
430 You can also look for information at:
431  
432 =over 4
433  
434 =item * GitHub
435  
436 L<https://github.com/nalobin/WWW-Wappalyzer>
437  
438 =item * RT: CPAN's request tracker (report bugs here)
439  
440 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Wappalyzer>
441  
442 =item * AnnoCPAN: Annotated CPAN documentation
443  
444 L<http://annocpan.org/dist/WWW-Wappalyzer>
445  
446 =item * CPAN Ratings
447  
448 L<http://cpanratings.perl.org/d/WWW-Wappalyzer>
449  
450 =item * Search CPAN
451  
452 L<http://search.cpan.org/dist/WWW-Wappalyzer/>
453  
454 =back
455  
456  
457 =head1 ACKNOWLEDGEMENTS
458  
459  
460 =head1 LICENSE AND COPYRIGHT
461  
462 Copyright 2013-2015 Alexander Nalobin.
463  
464 This program is free software; you can redistribute it and/or modify it
465 under the terms of either: the GNU General Public License as published
466 by the Free Software Foundation; or the Artistic License.
467  
468 See http://dev.perl.org/licenses/ for more information.
469  
470  
471 =cut
472  
473 3 1; # End of WWW::Wappalyzer
↑ Summary