fix: json files are now categorised by country
This commit is contained in:
parent
4a47097ea2
commit
36bdef3bd1
|
@ -8,7 +8,7 @@ deploy_job:
|
||||||
stage: deploy_stage
|
stage: deploy_stage
|
||||||
|
|
||||||
before_script:
|
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)
|
- eval $(ssh-agent -s)
|
||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
|
@ -17,7 +17,7 @@ deploy_job:
|
||||||
- chmod 644 ~/.ssh/known_hosts
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sh script.sh
|
- sh src/script.sh
|
||||||
|
|
||||||
- git checkout master
|
- git checkout master
|
||||||
- git config --global user.name "curben-bot"
|
- git config --global user.name "curben-bot"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,14 +13,17 @@ const f = async () => {
|
||||||
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
# Source: https://github.com/duckduckgo/tracker-radar\n`)
|
# Source: https://github.com/duckduckgo/tracker-radar\n`)
|
||||||
const domains = join(__dirname, '../tmp/tracker-radar/domains')
|
const domains = join(__dirname, '../tmp/tracker-radar/domains')
|
||||||
const files = await readdir(domains)
|
const countries = await readdir(domains)
|
||||||
for (const file of files) {
|
for (const country of countries) {
|
||||||
const data = await readFile(join(domains, file))
|
const files = await readdir(join(domains, country))
|
||||||
const { resources } = parse(data)
|
for (const file of files) {
|
||||||
const tracking = resources.filter(({ fingerprinting }) => fingerprinting === 1)
|
const data = await readFile(join(domains, country, file))
|
||||||
for (const { rule } of tracking) {
|
const { resources } = parse(data)
|
||||||
const link = rule.replace(/\\/g, '') + '\n'
|
const tracking = resources.filter(({ fingerprinting }) => fingerprinting === 1)
|
||||||
await appendFile(outputFile, link)
|
for (const { rule } of tracking) {
|
||||||
|
const link = rule.replace(/\\/g, '') + '\n'
|
||||||
|
await appendFile(outputFile, link)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue