-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
32,252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require("fs"); | ||
const axios = require("axios"); | ||
|
||
async function update() { | ||
// Fetch latest trackers data from whotracks.me | ||
const { trackers, companies } = (await axios.get( | ||
"https://whotracks.me/data/trackerdb.json" | ||
)).data; | ||
|
||
// Create mapping from tracker domain to company name | ||
const companyMapping = {}; | ||
for (const [tracker, { company_id, domains }] of Object.entries(trackers)) { | ||
const companyName = (companies[company_id] || { name: "unknown" }).name; | ||
for (const domain of domains) { | ||
companyMapping[domain] = companyName; | ||
} | ||
} | ||
|
||
// Save mapping on disk | ||
fs.writeFileSync("whotracksme.json", JSON.stringify(companyMapping), { | ||
encoding: "utf-8" | ||
}); | ||
} | ||
|
||
update(); |
Oops, something went wrong.