From 43f9b2511d22e840e2416938e388a7d5578bdaef Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:29:44 +0200 Subject: [PATCH 1/7] Fixed the path issue when packaged to NPM --- src/drivers/npm/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/drivers/npm/index.js b/src/drivers/npm/index.js index 153273a70..dd1ed8229 100644 --- a/src/drivers/npm/index.js +++ b/src/drivers/npm/index.js @@ -81,7 +81,20 @@ function getHTMLFromUrl(url, cb) { } function getAppsJson(cb) { - fs.readFile(path.resolve(__dirname, '../../apps.json'), 'utf8', function(err, data) { + + // depending on evironment select a direction to the path + var appsFileStr = path.resolve(__dirname, './apps.json'); + + // handle the environment variable if it's there + if(process.env.NODE_ENV == 'testing') { + + // set the apps.json to testing stage + appsFileStr = path.resolve(__dirname, '../../apps.json'); + + } + + // read in the file + fs.readFile(appsFileStr, 'utf8', function(err, data) { if (err) throw err; return cb(null, JSON.parse(data)); }); From 54b9ce1006a34a9dd3b1d1e10bdc69e319d3868d Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:30:02 +0200 Subject: [PATCH 2/7] Upped with the version with one increment --- src/drivers/npm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/npm/package.json b/src/drivers/npm/package.json index 71171aac7..cff4a2833 100644 --- a/src/drivers/npm/package.json +++ b/src/drivers/npm/package.json @@ -1,6 +1,6 @@ { "name": "wappalyzer", - "version": "2.0.2", + "version": "2.0.3", "description": "NPM Module that uncovers the technologies used on websites", "main": "index.js", "scripts": { From 2406cb2a9c631d5175adb90085f1a7c3256f99ac Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:31:17 +0200 Subject: [PATCH 3/7] Start of changes to README --- src/drivers/npm/README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/drivers/npm/README.md b/src/drivers/npm/README.md index dbe53753d..2aa2e10ac 100644 --- a/src/drivers/npm/README.md +++ b/src/drivers/npm/README.md @@ -14,8 +14,34 @@ This is npm module for wappalyzer debug:false } + // detect from the url directly, library will make a request wappalyzer.detectFromUrl(options,function (err,apps,appInfo) { - console.log(err,apps,appInfo); + + // output for the test + console.dir(apps); + console.dir(appInfo); + + }) + + var data = { + + url: options.url, + headers: { + + test: 1 + + }, + html: '

HTML CONTENT OF PAGE HERE

' + + }; + + // detect from content you have already + wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { + + // output for the test + console.dir(apps); + console.log(appInfo); + }) From dc9ea3164dd519a1fadd44277e8919aa245ab303 Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:40:11 +0200 Subject: [PATCH 4/7] Updated the readme with new method and new sample along with formatting update to match NPMJS.org --- src/drivers/npm/README.md | 235 ++++++++++++++++++++++---------------- 1 file changed, 138 insertions(+), 97 deletions(-) diff --git a/src/drivers/npm/README.md b/src/drivers/npm/README.md index 2aa2e10ac..93c1794c0 100644 --- a/src/drivers/npm/README.md +++ b/src/drivers/npm/README.md @@ -1,102 +1,139 @@ # Wappalyzer -This is npm module for wappalyzer - - npm install wappalyzer - - - var wappalyzer = require("wappalyzer"); - - - var options={ - url : "http://codelanka.github.io/Presentation-Engines", - hostname:"codelanka.github.io", - debug:false - } - - // detect from the url directly, library will make a request - wappalyzer.detectFromUrl(options,function (err,apps,appInfo) { - - // output for the test - console.dir(apps); - console.dir(appInfo); - - }) - - var data = { - - url: options.url, - headers: { - - test: 1 - - }, - html: '

HTML CONTENT OF PAGE HERE

' - - }; - - // detect from content you have already - wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { - - // output for the test - console.dir(apps); - console.log(appInfo); - - }) - - -####Output - - - null [ 'AngularJS', - 'Font Awesome', - 'Google Font API', - 'jQuery', - 'Twitter Bootstrap' ] { AngularJS: - { app: 'AngularJS', - confidence: - { 'script //([\\d.]+(\\-?rc[.\\d]*)*)/angular(\\.min)?\\.js/i': 100, - 'script /angular.*\\.js/i': 100 }, - confidenceTotal: 100, - detected: true, - excludes: [], - version: '1.3.5', - versions: [ '1.3.5' ] }, - 'Font Awesome': - { app: 'Font Awesome', - confidence: { 'html /]* href=[^>]+font-awesome(?:\\.min)?\\.css/i': 100 }, - confidenceTotal: 100, - detected: true, - excludes: [], - version: '', - versions: [] }, - 'Google Font API': - { app: 'Google Font API', - confidence: { 'html /]* href=[^>]+fonts\\.(?:googleapis|google)\\.com/i': 100 }, - confidenceTotal: 100, - detected: true, - excludes: [], - version: '', - versions: [] }, - jQuery: - { app: 'jQuery', - confidence: { 'script /jquery.*\\.js/i': 100 }, - confidenceTotal: 100, - detected: true, - excludes: [], - version: '', - versions: [] }, - 'Twitter Bootstrap': - { app: 'Twitter Bootstrap', - confidence: - { 'script /(?:twitter\\.github\\.com/bootstrap|bootstrap(?:\\.js|\\.min\\.js))/i': 100, - 'html /HTML CONTENT OF PAGE HERE

' + +}; + +// detect from content you have already +wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { + + // output for the test + console.dir(apps); + console.log(appInfo); + +}) +``` +### Output from QuickStart + +```javascript + +// Apps +[ + 'CloudFlare', + 'Font Awesome', + 'Google Maps', + 'Modernizr', + 'Nginx', + 'RequireJS', + 'jQuery' +] + +// Detailed info on links +{ + CloudFlare: { + app: 'CloudFlare', + confidence: { 'headers Server /cloudflare/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '', + versions: [] + }, + 'Font Awesome': { + app: 'Font Awesome', + confidence: { 'html /]* href=[^>]+font-awesome(?:\.min)?\.css/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '', + versions: [] + }, + 'Google Maps': { + app: 'Google Maps', + confidence: { 'script ///maps.googleapis.com/maps/api/js/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '', + versions: [] }, + 'Modernizr': { + app: 'Modernizr', + confidence: { 'script /modernizr(?:-([\d.]*[\d]))?.*\.js/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '2.6.2', + versions: [ '2.6.2' ] }, + 'Nginx': { + app: 'Nginx', + confidence: { 'headers Server /nginx(?:/([\d.]+))?/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '', + versions: [] }, + 'RequireJS': { + app: 'RequireJS', + confidence: { 'script /require.*\.js/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '', + versions: [] }, + 'jQuery': { + app: 'jQuery', + confidence: + { 'script //([\d.]+)/jquery(\.min)?\.js/i': 100, + 'script /jquery.*\.js/i': 100 }, + confidenceTotal: 100, + detected: true, + excludes: [], + version: '1.10.1', + versions: [ '1.10.1' ] + } +} +``` +## Credits Wappalyzer Author - Elbert Alias @@ -115,8 +152,12 @@ Refer to the [wiki](https://github.com/AliasIO/Wappalyzer/wiki) for [contribute](https://github.com/AliasIO/Wappalyzer/wiki/Contributing) and [more](https://github.com/AliasIO/Wappalyzer/wiki/_pages). +## License + *Licensed under the [GPL](https://github.com/AliasIO/Wappalyzer/blob/master/LICENSE).* +## Donations + Donate Bitcoin: 16gb4uGDAjaeRJwKVmKr2EXa8x2fmvT8EQ - *Thanks!* ![QR Code](https://wappalyzer.com/sites/default/themes/wappalyzer/images/bitcoinqrcode.png) From 9064555dcd93a09aa81c12611fc5e5c6edc74eb6 Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:43:46 +0200 Subject: [PATCH 5/7] Updated the readme credits to reflect who helped --- src/drivers/npm/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drivers/npm/README.md b/src/drivers/npm/README.md index 93c1794c0..ee90272c2 100644 --- a/src/drivers/npm/README.md +++ b/src/drivers/npm/README.md @@ -135,7 +135,7 @@ wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { ``` ## Credits -Wappalyzer Author - Elbert Alias +### Wappalyzer Author - Elbert Alias [Wappalyzer](https://wappalyzer.com/) is a [cross-platform](https://github.com/AliasIO/Wappalyzer/wiki/Drivers) utility that uncovers the @@ -152,6 +152,11 @@ Refer to the [wiki](https://github.com/AliasIO/Wappalyzer/wiki) for [contribute](https://github.com/AliasIO/Wappalyzer/wiki/Contributing) and [more](https://github.com/AliasIO/Wappalyzer/wiki/_pages). +### NPM Module + +* [Pasindu De Silva](https://github.com/pasindud) - Initial version with tests +* [Johann du Toit](http://johanndutoit.net) from [Passmarked](http://passmarked.com) - Updated to support just passing data and helped publish to NPMJS + ## License *Licensed under the [GPL](https://github.com/AliasIO/Wappalyzer/blob/master/LICENSE).* From 107ce4facf7b20f3ee6e25075e5ff23c8a02c774 Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:45:16 +0200 Subject: [PATCH 6/7] Small formatting update in output code --- src/drivers/npm/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/drivers/npm/README.md b/src/drivers/npm/README.md index ee90272c2..e7282dd61 100644 --- a/src/drivers/npm/README.md +++ b/src/drivers/npm/README.md @@ -95,7 +95,8 @@ wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { detected: true, excludes: [], version: '', - versions: [] }, + versions: [] + }, 'Modernizr': { app: 'Modernizr', confidence: { 'script /modernizr(?:-([\d.]*[\d]))?.*\.js/i': 100 }, @@ -103,7 +104,8 @@ wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { detected: true, excludes: [], version: '2.6.2', - versions: [ '2.6.2' ] }, + versions: [ '2.6.2' ] + }, 'Nginx': { app: 'Nginx', confidence: { 'headers Server /nginx(?:/([\d.]+))?/i': 100 }, @@ -111,7 +113,8 @@ wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { detected: true, excludes: [], version: '', - versions: [] }, + versions: [] + }, 'RequireJS': { app: 'RequireJS', confidence: { 'script /require.*\.js/i': 100 }, @@ -119,7 +122,8 @@ wappalyzer.detectFromHTML(options,function (err,apps,appInfo) { detected: true, excludes: [], version: '', - versions: [] }, + versions: [] + }, 'jQuery': { app: 'jQuery', confidence: From f653554c05a405dc9b647daacc64ae009daeca7b Mon Sep 17 00:00:00 2001 From: Johann du Toit Date: Sun, 19 Jul 2015 05:48:18 +0200 Subject: [PATCH 7/7] Updated package to reflect package atm. Including moved me and Pasindu to contributors and Elbert to author --- src/drivers/npm/package.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/drivers/npm/package.json b/src/drivers/npm/package.json index cff4a2833..a342ed19c 100644 --- a/src/drivers/npm/package.json +++ b/src/drivers/npm/package.json @@ -11,9 +11,20 @@ "url": "https://github.com/AliasIO/Wappalyzer" }, "keywords": [ - "wappalyzer" + "wappalyzer", + "detect", + "stack", + "technologies" ], - "author": "Pasindu De Silva", + "contributors": [ + { + "name": "Pasindu De Silva" + }, + { + "name": "Johann du Toit" + } + ], + "author": "Elbert Alias", "license": "GPLv3", "bugs": { "url": "https://github.com/AliasIO/Wappalyzer/issues"