fix: json files are now categorised by country

This commit is contained in:
Ming Di Leom 2021-05-22 03:06:13 +00:00
parent 4a47097ea2
commit 36bdef3bd1
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
3 changed files with 95049 additions and 21754 deletions

View File

@ -8,7 +8,7 @@ deploy_job:
stage: deploy_stage
before_script:
- 'which ssh-agent || (apk update && apk add openssh-client git)'
- 'which ssh-agent || (apk update && apk add curl git openssh-client)'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
@ -17,7 +17,7 @@ deploy_job:
- chmod 644 ~/.ssh/known_hosts
script:
- sh script.sh
- sh src/script.sh
- git checkout master
- git config --global user.name "curben-bot"

116780
dist/tracking-data.txt vendored

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,17 @@ const f = async () => {
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
# Source: https://github.com/duckduckgo/tracker-radar\n`)
const domains = join(__dirname, '../tmp/tracker-radar/domains')
const files = await readdir(domains)
for (const file of files) {
const data = await readFile(join(domains, file))
const { resources } = parse(data)
const tracking = resources.filter(({ fingerprinting }) => fingerprinting === 1)
for (const { rule } of tracking) {
const link = rule.replace(/\\/g, '') + '\n'
await appendFile(outputFile, link)
const countries = await readdir(domains)
for (const country of countries) {
const files = await readdir(join(domains, country))
for (const file of files) {
const data = await readFile(join(domains, country, file))
const { resources } = parse(data)
const tracking = resources.filter(({ fingerprinting }) => fingerprinting === 1)
for (const { rule } of tracking) {
const link = rule.replace(/\\/g, '') + '\n'
await appendFile(outputFile, link)
}
}
}
}