From 9c0ff2e6b8272c8e85695414ad1493b3d7c38d44 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sat, 24 Nov 2012 11:07:16 +1100 Subject: [PATCH] Meta data --- drivers/bookmarklet/js/wappalyzer.js | 24 +++++++++--- drivers/bookmarklet/json | 2 +- drivers/chrome/apps.json | 2 +- drivers/chrome/js/wappalyzer.js | 24 +++++++++--- drivers/firefox-jetpack/data/apps.json | 2 +- drivers/firefox-jetpack/lib/wappalyzer.js | 24 +++++++++--- drivers/firefox/content/apps.json | 4 +- drivers/firefox/content/js/lib/jquery.min.js | 2 + drivers/firefox/content/js/wappalyzer.js | 24 +++++++++--- .../firefox/skin/images/icons/ReallyCMS.png | Bin 0 -> 847 bytes drivers/html/apps.json | 2 +- drivers/html/js/wappalyzer.js | 24 +++++++++--- drivers/php/apps.json | 2 +- drivers/php/js/wappalyzer.js | 24 +++++++++--- links.sh | 36 +++++++++--------- share/apps.json | 2 +- share/js/wappalyzer.js | 24 +++++++++--- 17 files changed, 160 insertions(+), 62 deletions(-) create mode 100644 drivers/firefox/content/js/lib/jquery.min.js create mode 100644 drivers/firefox/skin/images/icons/ReallyCMS.png diff --git a/drivers/bookmarklet/js/wappalyzer.js b/drivers/bookmarklet/js/wappalyzer.js index 5d1631368..5b9ff7918 100644 --- a/drivers/bookmarklet/js/wappalyzer.js +++ b/drivers/bookmarklet/js/wappalyzer.js @@ -66,7 +66,7 @@ var wappalyzer = (function() { // Checks if ( w.driver == null ) { w.log('no driver, exiting'); - +G return; } @@ -180,7 +180,7 @@ var wappalyzer = (function() { profiler.regexCount ++; - regexMeta = new RegExp(']+>', 'ig'); + regexMeta = /]+>/ig; while ( match = regexMeta.exec(data.html) ) { for ( meta in w.apps[app][type] ) { @@ -271,13 +271,13 @@ var wappalyzer = (function() { w.log(apps.length + ' apps detected: ' + apps.join(', ') + ' on ' + url); // Keep history of detected apps - var i, app, match; + var i, app, regex, regexMeta, match; for ( i in apps ) { app = apps[i]; // Per hostname - if ( /^[a-z0-9._\-]+\.[a-z]+/.test(hostname) && !/(dev\.|\/admin|\.local)/.test(url) ) { + if ( /^[a-z0-9._\-]+\.[a-z]+/.test(hostname) && !/((local|dev|development|stage|staging|test|testing|demo|admin)\.|\/admin|\.local)/.test(url) ) { if ( typeof w.ping.hostnames === 'undefined' ) { w.ping.hostnames = {}; } @@ -300,12 +300,26 @@ var wappalyzer = (function() { // Additional information if ( typeof w.ping.hostnames !== 'undefined' && typeof w.ping.hostnames[hostname] !== 'undefined' ) { if ( data.html != null ) { - match = data.html.match(/]*[: ]lang="([^"]+)"/); + match = data.html.match(/]*[: ]lang="([a-z]{2}((-|_)[A-Z]{2})?)"/i); if ( match != null && match.length ) { w.ping.hostnames[hostname].meta['language'] = match[1]; } + + regexMeta = /]+>/ig; + + while ( match = regexMeta.exec(data.html) ) { + if ( !match.length ) { continue; } + + match = match[0].match(/name="(author|copyright|country|description|keywords)"[^>]*content="([^"]+)"/i); + + if ( match && match.length === 3 ) { + w.ping.hostnames[hostname].meta[match[1]] = match[2]; + } + } } + + w.log(hostname + ': ' + JSON.stringify(w.ping.hostnames[hostname])); } if ( w.ping.hostnames != null && Object.keys(w.ping.hostnames).length >= 50 ) { driver('ping'); } diff --git a/drivers/bookmarklet/json b/drivers/bookmarklet/json index e9c0a5867..367002fdc 100644 --- a/drivers/bookmarklet/json +++ b/drivers/bookmarklet/json @@ -323,7 +323,7 @@ "implies": [ "node.js" ] }, "Contao": { - "cats": [ 1, 6 ], + "cats": [ 1 ], "html": "(