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 | ||||
| 
 | ||||
|   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" | ||||
|  |  | |||
										
											
												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/
 | ||||
| # 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) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue