Fix French language, clear robots.txt cache regularly

main
Elbert Alias 7 years ago
parent 5d5c9e3aca
commit f61697c9f4

@ -1,4 +1,4 @@
{ {
"github": { "message": "Forker Wappalyzer sur GitHub!" }, "github": { "message": "Forker Wappalyzer sur GitHub!" },
"noAppsDetected": { "message": "Pas d'applications détectées." }, "noAppsDetected": { "message": "Pas d'applications détectées." },
"nothingToDo": { "message": "Rien à faire ici." }, "nothingToDo": { "message": "Rien à faire ici." },
@ -36,7 +36,7 @@
"categoryName24": { "message": "Editeur WYSIWYG" }, "categoryName24": { "message": "Editeur WYSIWYG" },
"categoryName25": { "message": "Graphismes JavaScript" }, "categoryName25": { "message": "Graphismes JavaScript" },
"categoryName26": { "message": "Framework pour mobiles" }, "categoryName26": { "message": "Framework pour mobiles" },
"categoryName27": { "message": "Language de programmation" }, "categoryName27": { "message": "Langage de programmation" },
"categoryName28": { "message": "Système d'exploitation" }, "categoryName28": { "message": "Système d'exploitation" },
"categoryName29": { "message": "Moteur de recherche" }, "categoryName29": { "message": "Moteur de recherche" },
"categoryName30": { "message": "Web Mail" }, "categoryName30": { "message": "Web Mail" },

@ -61,7 +61,7 @@ function openTab(args) {
function post(url, body) { function post(url, body) {
fetch(url, { fetch(url, {
method: 'POST', method: 'POST',
body body: JSON.stringify(body)
}) })
.then(response => { .then(response => {
wappalyzer.log('POST ' + url + ': ' + response.status, 'driver'); wappalyzer.log('POST ' + url + ': ' + response.status, 'driver');
@ -306,12 +306,19 @@ wappalyzer.driver.getRobotsTxt = (host, secure = false) => {
/** /**
* Anonymously track detected applications for research purposes * Anonymously track detected applications for research purposes
*/ */
wappalyzer.driver.ping = (ping, adCache) => { wappalyzer.driver.ping = (hostnameCache, adCache) => {
getOption('tracking', true) getOption('tracking', true)
.then(tracking => { .then(tracking => {
if ( tracking ) { if ( tracking ) {
post('http://ping.wappalyzer.com/v2/', ping); if ( Object.keys(hostnameCache).length ) {
post('http://ping.wappalyzer.com/v2/', hostnameCache);
}
if ( adCache.length ) {
post('https://ad.wappalyzer.com/log/wp/', adCache); post('https://ad.wappalyzer.com/log/wp/', adCache);
} }
setOption('robotsTxtCache', {});
}
}); });
}; };

@ -165,6 +165,18 @@ wappalyzer.parseRobotsTxt = robotsTxt => {
return disallow; return disallow;
} }
/**
*
*/
wappalyzer.ping() {
if ( Object.keys(hostnameCache).length >= 50 || adCache.length >= 50 ) {
wappalyzer.driver.ping(hostnameCache, adCache);
hostnameCache = {};
adCache = [];
}
}
/** /**
* Enclose string in array * Enclose string in array
*/ */
@ -287,6 +299,8 @@ function resolveImplies(apps, url) {
* Cache detected applications * Cache detected applications
*/ */
function cacheDetectedApps(apps, url) { function cacheDetectedApps(apps, url) {
wappalyzer.driver.ping instanceof Function || return;
Object.keys(apps).forEach(appName => { Object.keys(apps).forEach(appName => {
var app = apps[appName]; var app = apps[appName];
@ -297,15 +311,15 @@ function cacheDetectedApps(apps, url) {
detected[url][appName].confidence[id] = app.confidence[id]; detected[url][appName].confidence[id] = app.confidence[id];
}); });
}) })
wappalyzer.ping();
} }
/** /**
* Track detected applications * Track detected applications
*/ */
function trackDetectedApps(apps, url, hostname, html) { function trackDetectedApps(apps, url, hostname, html) {
if ( !( wappalyzer.driver.ping instanceof Function ) ) { wappalyzer.driver.ping instanceof Function || return;
return;
}
Object.keys(apps).forEach(appName => { Object.keys(apps).forEach(appName => {
var app = apps[appName]; var app = apps[appName];
@ -347,12 +361,7 @@ function trackDetectedApps(apps, url, hostname, html) {
} }
} }
if ( Object.keys(hostnameCache).length >= 50 || adCache.length >= 50 ) { wappalyzer.ping();
wappalyzer.driver.ping(hostnameCache, adCache);
hostnameCache = {};
adCache = [];
}
} }
/** /**

Loading…
Cancel
Save