Moving apps.js to apps.json

main
Elbert Alias 13 years ago
parent 256e680b15
commit eab3d824ef

@ -17,22 +17,22 @@ Contributing
**Adding a new application** **Adding a new application**
* Edit `share/apps.js` * Edit `share/apps.json`
* Add a 16x16 PNG image to `share/images/icons` matching the application name. * Add a 16x16 PNG image to `share/images/icons` matching the application name.
* Provide the URL to the application's website when submitting a pull request. * Provide the URL to the application's website when submitting a pull request.
Example: Example:
```javascript ```javascript
'Application Name': { "Application Name": {
cats: [ 1 ], cats: [ "1" ],
headers: { 'X-Powered-By': /Application Name/i }, headers: { "X-Powered-By": "Application Name" },
url: /.+\.application-name\.com/, url: ".+\\.application-name\\.com",
html: /<link[^>]application-name\.css/, html: "<link[^>]application-name\\.css",
meta: { 'generator': /Application Name/i }, meta: { "generator": "Application Name" },
script: /application-name\.js/, script: "application-name\\.js",
env: /ApplicationName/, env: "ApplicationName",
implies: [ 'PHP' ] implies: [ "PHP" ]
} }
``` ```

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

File diff suppressed because it is too large Load Diff

@ -1,14 +1,14 @@
{ {
"categories": { "categories": {
"1": "cms", "1": "cms",
"2": "message-boards", "2": "message-boards",
"3": "database-managers", "3": "database-managers",
"4": "documentation-tools", "4": "documentation-tools",
"5": "widgets", "5": "widgets",
"6": "web-shops", "6": "web-shops",
"7": "photo-galleries", "7": "photo-galleries",
"8": "wikis", "8": "wikis",
"9": "hosting-panels", "9": "hosting-panels",
"10": "analytics", "10": "analytics",
"11": "blogs", "11": "blogs",
"12": "javascript-frameworks", "12": "javascript-frameworks",
@ -50,10 +50,10 @@
"meta": { "generator": "2z project" } "meta": { "generator": "2z project" }
}, },
"Accessible Portal": { "Accessible Portal": {
"cats": [ "1" ], "cats": [ "1" ],
"meta": { "generator": "Accessible Portal" }, "meta": { "generator": "Accessible Portal" },
"implies": [ "PHP" ] "implies": [ "PHP" ]
}, },
"AddThis": { "AddThis": {
"cats": [ "5" ], "cats": [ "5" ],
"script": "addthis\\.com/js", "script": "addthis\\.com/js",
@ -182,7 +182,7 @@
"Blogger": { "Blogger": {
"cats": [ "11" ], "cats": [ "11" ],
"meta": { "generator": "blogger" "meta": { "generator": "blogger"
}, },
"url": "^(www.)?.+\\.blogspot\\.com" "url": "^(www.)?.+\\.blogspot\\.com"
}, },
"BrowserCMS": { "BrowserCMS": {
@ -995,7 +995,7 @@
"headers": { "Server": "nginx" } "headers": { "Server": "nginx" }
}, },
"node.js": { "node.js": {
"cats": [ "27" ], "cats": [ "27" ]
}, },
"NOIX": { "NOIX": {
"cats": [ "19" ], "cats": [ "19" ],
@ -1053,11 +1053,11 @@
"html": "<body onload=\\\"window\\.defaultStatus='oscss templates';\\\"" "html": "<body onload=\\\"window\\.defaultStatus='oscss templates';\\\""
}, },
"Outbrain": { "Outbrain": {
"cats": [ "5" ], "cats": [ "5" ],
"html": "var OB_langJS = 'http://widgets\\.outbrain\\.com/lang_", "html": "var OB_langJS = 'http://widgets\\.outbrain\\.com/lang_",
"script": "http://widgets\\.outbrain\\.com/outbrain\\.js", "script": "http://widgets\\.outbrain\\.com/outbrain\\.js",
"env": "^OutbrainPermaLink$" "env": "^OutbrainPermaLink$"
}, },
"OXID eShop": { "OXID eShop": {
"cats": [ "6" ], "cats": [ "6" ],
"html": "<!--.*OXID eShop", "html": "<!--.*OXID eShop",
@ -1382,10 +1382,10 @@
"html": "Shopsystem von <a href=\\\"http://www\\.store-systems\\.de\\\"|\\.mws_boxTop" "html": "Shopsystem von <a href=\\\"http://www\\.store-systems\\.de\\\"|\\.mws_boxTop"
}, },
"SublimeVideo": { "SublimeVideo": {
"cats": [ "14" ], "cats": [ "14" ],
"script": "http://cdn\\.sublimevideo\\.net/js/[a-z0-9]+\\.js", "script": "http://cdn\\.sublimevideo\\.net/js/[a-z0-9]+\\.js",
"env": "^sublimevideo$" "env": "^sublimevideo$"
}, },
"SWFObject": { "SWFObject": {
"cats": [ "19" ], "cats": [ "19" ],
"script": "swfobject.*\\.js", "script": "swfobject.*\\.js",
@ -1536,7 +1536,7 @@
"VIVVO": { "VIVVO": {
"cats": [ "1" ], "cats": [ "1" ],
"headers": { "Set-Cookie": "VivvoSessionId", "headers": { "Set-Cookie": "VivvoSessionId",
"env": "^vivvo" } "env": "^vivvo" }
}, },
"Volusion": { "Volusion": {
"cats": [ "6" ], "cats": [ "6" ],
@ -1601,7 +1601,7 @@
"WikkaWiki": { "WikkaWiki": {
"cats": [ "8" ], "cats": [ "8" ],
"meta": { "generator": "WikkaWiki" "meta": { "generator": "WikkaWiki"
}, },
"html": "Powered by <a href=\\\"[^>]+WikkaWiki" "html": "Powered by <a href=\\\"[^>]+WikkaWiki"
}, },
"Windows Server": { "Windows Server": {

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -37,6 +37,23 @@
strings = document.getElementById('wappalyzer-strings'); strings = document.getElementById('wappalyzer-strings');
// Read apps.json
var xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1'].createInstance(Ci.nsIXMLHttpRequest);
//xhr.overrideMimeType('text/plain');
xhr.overrideMimeType('application/json');
xhr.open('GET', 'chrome://wappalyzer/content/apps.json', true);
xhr.onload = function(e) {
var json = JSON.parse(xhr.responseText);
w.categories = json.categories;
w.apps = json.apps;
};
xhr.send(null);
AddonManager.getAddonByID('wappalyzer@crunchlabz.com', function(addon) { AddonManager.getAddonByID('wappalyzer@crunchlabz.com', function(addon) {
// Load jQuery // Load jQuery
Cc['@mozilla.org/moz/jssubscript-loader;1'].getService(Ci.mozIJSSubScriptLoader).loadSubScript('chrome://wappalyzer/content/js/lib/jquery.min.js'); Cc['@mozilla.org/moz/jssubscript-loader;1'].getService(Ci.mozIJSSubScriptLoader).loadSubScript('chrome://wappalyzer/content/js/lib/jquery.min.js');

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

@ -6,7 +6,6 @@
<overlay id="wappalyzer-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <overlay id="wappalyzer-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://wappalyzer/content/js/wappalyzer.js"/> <script type="application/x-javascript" src="chrome://wappalyzer/content/js/wappalyzer.js"/>
<script type="application/x-javascript" src="chrome://wappalyzer/content/js/apps.js"/>
<script type="application/x-javascript" src="chrome://wappalyzer/content/js/driver.js"/> <script type="application/x-javascript" src="chrome://wappalyzer/content/js/driver.js"/>
<stringbundleset id="stringbundleset"> <stringbundleset id="stringbundleset">

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }

@ -1,28 +1,28 @@
#!/bin/sh #!/bin/sh
ln -f share/images/icons/* drivers/firefox/skin/images/icons ln -f share/images/icons/* drivers/firefox/skin/images/icons
ln -f share/js/apps.js drivers/firefox/content/js/ ln -f share/js/lib/jquery.min.js drivers/firefox/content/js/lib
ln -f share/js/wappalyzer.js drivers/firefox/content/js/ ln -f share/apps.json drivers/firefox/content
ln -f share/js/wappalyzer.js drivers/firefox/content/js
ln -f share/images/icons/* drivers/firefox-jetpack/images/icons ln -f share/images/icons/* drivers/firefox-jetpack/images/icons
ln -f share/js/lib/jquery.min.js drivers/firefox-jetpack/lib ln -f share/apps.json drivers/firefox-jetpack/data
ln -f share/js/apps.js drivers/firefox-jetpack/lib
ln -f share/js/wappalyzer.js drivers/firefox-jetpack/lib ln -f share/js/wappalyzer.js drivers/firefox-jetpack/lib
ln -f share/images/icons/* drivers/chrome/images/icons ln -f share/images/icons/* drivers/chrome/images/icons
ln -f share/js/lib/jquery.min.js drivers/chrome/js/lib ln -f share/js/lib/jquery.min.js drivers/chrome/js/lib
ln -f share/js/apps.js drivers/chrome/js/ ln -f share/apps.json drivers/chrome
ln -f share/js/wappalyzer.js drivers/chrome/js/ ln -f share/js/wappalyzer.js drivers/chrome/js
ln -f share/images/icons/* drivers/bookmarklet/images/icons ln -f share/images/icons/* drivers/bookmarklet/images/icons
ln -f share/js/lib/jquery.min.js drivers/bookmarklet/js/lib ln -f share/js/lib/jquery.min.js drivers/bookmarklet/js/lib
ln -f share/js/apps.js drivers/bookmarklet/js/ ln -f share/apps.json drivers/bookmarklet/json
ln -f share/js/wappalyzer.js drivers/bookmarklet/js/ ln -f share/js/wappalyzer.js drivers/bookmarklet/js
ln -f share/images/icons/* drivers/html/images/icons ln -f share/images/icons/* drivers/html/images/icons
ln -f share/js/lib/jquery.min.js drivers/html/js/lib ln -f share/js/lib/jquery.min.js drivers/html/js/lib
ln -f share/js/apps.js drivers/html/js/ ln -f share/apps.json drivers/html
ln -f share/js/wappalyzer.js drivers/html/js/ ln -f share/js/wappalyzer.js drivers/html/js
ln -f share/js/apps.js drivers/php/js/ ln -f share/apps.json drivers/php
ln -f share/js/wappalyzer.js drivers/php/js/ ln -f share/js/wappalyzer.js drivers/php/js

File diff suppressed because it is too large Load Diff

@ -28,7 +28,8 @@ var wappalyzer = wappalyzer || (function() {
* Main script * Main script
*/ */
var w = { var w = {
// Cache detected applications per URL apps: null,
cats: null,
ping: {}, ping: {},
detected: [], detected: [],
@ -69,12 +70,6 @@ var wappalyzer = wappalyzer || (function() {
return; return;
} }
if ( w.apps == null || w.categories == null ) {
w.log('apps.js not loaded, exiting');
return;
}
// Initialize driver // Initialize driver
driver('init', function() { driver('init', function() {
if ( w.config.firstRun ) { if ( w.config.firstRun ) {
@ -97,6 +92,12 @@ var wappalyzer = wappalyzer || (function() {
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
w.log('w.analyze'); w.log('w.analyze');
if ( w.apps == null || w.categories == null ) {
w.log('apps.json not loaded');
return;
}
var i, app, type, regex, match, content, meta, header, apps = []; var i, app, type, regex, match, content, meta, header, apps = [];
if ( w.detected[url] == null ) { w.detected[url] = []; } if ( w.detected[url] == null ) { w.detected[url] = []; }