Loading build_list.js +18 −6 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ const outputFile = "list/e_trackers.json" const adawayUri = "https://adaway.org/hosts.txt" const exodusUri = "https://reports.exodus-privacy.eu.org/api/trackers" const whitelistedDomains = [ "login.microsoftonline.com", ] const https = require('https') const fs = require('fs') Loading Loading @@ -31,9 +34,6 @@ let trackers = [] console.log("Starting list update") fetch(adawayUri) //.then(response => { // return response.text() //}) .then(text => { adawayText = text hostnames = parseHostToHostnames(text) Loading @@ -41,7 +41,6 @@ fetch(adawayUri) }).then(toto => { return fetch(exodusUri) }) //.then(response => { return response.json()}) .then(response => { return JSON.parse(response) }) .then(json => { exoduxJson = json Loading @@ -54,6 +53,9 @@ fetch(adawayUri) hostnames = enrichExodusWithAdaway(trackers, hostnames) console.log("enrich exodus OK") hostnames = createdLevel2Trackers(trackers, hostnames) console.log("define adaway trackers OK") removeWhitelistedHostnames(trackers) console.log("remove whitelisted hostnames OK") console.log("Trackers list finished") }) .then(toto => { Loading Loading @@ -93,7 +95,7 @@ function exodusToETrackers(exodusTrackers) { .map(tracker => { const id = "exodus_" + tracker.id const hostnames = tracker.network_signature .replaceAll("\\", "") .replace(/\\/g, "") .split("|") return { id: id, Loading Loading @@ -157,6 +159,16 @@ function toLevel2Domain(hostname) { } } function removeWhitelistedHostnames(trackersList) { var emptyTrackersIndexes = [] trackersList.forEach((tracker, index) => { tracker.hostnames = tracker.hostnames.filter(host => whitelistedDomains.indexOf(host) < 0) if (tracker.hostnames.length == 0) { emptyTrackersIndexes.unshift(index) } }) emptyTrackersIndexes.forEach(index => trackersList.splice(index, 1)) } function listHasNoChanges() { // Compare actual list with the builded one (without the createdAt field!) Loading list/e_trackers.json +1 −1 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
build_list.js +18 −6 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ const outputFile = "list/e_trackers.json" const adawayUri = "https://adaway.org/hosts.txt" const exodusUri = "https://reports.exodus-privacy.eu.org/api/trackers" const whitelistedDomains = [ "login.microsoftonline.com", ] const https = require('https') const fs = require('fs') Loading Loading @@ -31,9 +34,6 @@ let trackers = [] console.log("Starting list update") fetch(adawayUri) //.then(response => { // return response.text() //}) .then(text => { adawayText = text hostnames = parseHostToHostnames(text) Loading @@ -41,7 +41,6 @@ fetch(adawayUri) }).then(toto => { return fetch(exodusUri) }) //.then(response => { return response.json()}) .then(response => { return JSON.parse(response) }) .then(json => { exoduxJson = json Loading @@ -54,6 +53,9 @@ fetch(adawayUri) hostnames = enrichExodusWithAdaway(trackers, hostnames) console.log("enrich exodus OK") hostnames = createdLevel2Trackers(trackers, hostnames) console.log("define adaway trackers OK") removeWhitelistedHostnames(trackers) console.log("remove whitelisted hostnames OK") console.log("Trackers list finished") }) .then(toto => { Loading Loading @@ -93,7 +95,7 @@ function exodusToETrackers(exodusTrackers) { .map(tracker => { const id = "exodus_" + tracker.id const hostnames = tracker.network_signature .replaceAll("\\", "") .replace(/\\/g, "") .split("|") return { id: id, Loading Loading @@ -157,6 +159,16 @@ function toLevel2Domain(hostname) { } } function removeWhitelistedHostnames(trackersList) { var emptyTrackersIndexes = [] trackersList.forEach((tracker, index) => { tracker.hostnames = tracker.hostnames.filter(host => whitelistedDomains.indexOf(host) < 0) if (tracker.hostnames.length == 0) { emptyTrackersIndexes.unshift(index) } }) emptyTrackersIndexes.forEach(index => trackersList.splice(index, 1)) } function listHasNoChanges() { // Compare actual list with the builded one (without the createdAt field!) Loading