#!perl -T use Test::More tests => 6; BEGIN { use_ok( 'WWW::Wappalyzer' ) || print "Bail out!\n"; } my @cats = WWW::Wappalyzer::get_categories(); ok scalar @cats, 'get_categories'; ok scalar( grep { $_ eq 'cms' } @cats ), 'get_categories cms'; my $html = q{ Lib }; my %detected = WWW::Wappalyzer::detect( html => $html, headers => { Server => 'nginx', 'X-Powered-By' => 'PleskLin', }, ); is_deeply \%detected, { 'web-servers' => [ 'Nginx' ], cms => [ 'Joomla' ], 'javascript-frameworks' => [ 'jQuery', 'MooTools' ], 'hosting-panels' => [ 'Plesk' ], }, 'detect by html & headers'; %detected = WWW::Wappalyzer::detect( url => 'http://myblog.livejournal.com' ); is_deeply \%detected, { blogs => [ 'LiveJournal' ] }, 'detect by url'; %detected = WWW::Wappalyzer::detect( headers => { Server => 'nginx' }, cats => [ 'web-servers' ], ); is_deeply \%detected, { 'web-servers' => [ 'Nginx' ] }, 'detect single cat';