Skip to content

Commit

Permalink
Merge branch 'main' into add-pv-cdn.net
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-302 authored Nov 9, 2023
2 parents 42f8a3c + 09a5c76 commit 26c17dd
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/companies.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timeUpdated": "2023-10-22T00:09:43.045Z",
"timeUpdated": "2023-11-09T13:44:47.025Z",
"companies": {
"163": {
"name": "163",
Expand Down Expand Up @@ -6805,7 +6805,7 @@
"description": "MicroAd is a Japanese behavioral targeting ad delivery service. They offer contextual advertising services as well as retargeting and other ad delivery services."
},
"microsoft": {
"name": "Microsoft",
"name": "Microsoft Corporation",
"websiteUrl": "https://www.microsoft.com/",
"description": "Microsoft is an American multinational corporation that develops, manufactures, licenses, supports, and sells a range of software products and services.",
"source": "AdGuard"
Expand Down
5 changes: 4 additions & 1 deletion dist/trackers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ amazonpay.com;amazon_payments;2
payments-amazon.com;amazon_payments;2
amazonpay.in;amazon_payments;2
aiv-cdn.net;amazon_video;0
aiv-delivery.net;amazon_video;0
amazonvideo.com;amazon_video;0
primevideo.com;amazon_video;0
amazonaws.com;amazon_web_services;10
amazonwebservices.com;amazon_web_services;10
awsstatic.com;amazon_web_services;10
Expand Down Expand Up @@ -769,6 +771,7 @@ perfb.com;awin;4
ad.globe7.com;axill;4
azadify.com;azadify;4
azure.com;azure;10
azure.net;azure;10
azurefd.net;azure;10
trafficmanager.net;azure;10
blob.core.windows.net;azure_blob_storage;8
Expand Down Expand Up @@ -4990,7 +4993,7 @@ yellowpages.com;yp;4
prod-js.aws.y-track.com;ysance;4
y-track.com;ysance;4
yume.com;yume;4
yumenetworks.com;yume,_inc.;4
yumenetworks.com;"yume,_inc.";4
gravityrd-services.com;yusp;6
api.zadarma.com;zadarma;2
zalan.do;zalando_de;8
Expand Down
5 changes: 4 additions & 1 deletion dist/trackers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timeUpdated": "2023-10-22T00:09:43.045Z",
"timeUpdated": "2023-11-09T13:44:47.025Z",
"categories": {
"0": "audio_video_player",
"1": "comments",
Expand Down Expand Up @@ -20705,7 +20705,9 @@
"payments-amazon.com": "amazon_payments",
"amazonpay.in": "amazon_payments",
"aiv-cdn.net": "amazon_video",
"aiv-delivery.net": "amazon_video",
"amazonvideo.com": "amazon_video",
"primevideo.com": "amazon_video",
"amazonaws.com": "amazon_web_services",
"amazonwebservices.com": "amazon_web_services",
"awsstatic.com": "amazon_web_services",
Expand Down Expand Up @@ -20852,6 +20854,7 @@
"ad.globe7.com": "axill",
"azadify.com": "azadify",
"azure.com": "azure",
"azure.net": "azure",
"azurefd.net": "azure",
"trafficmanager.net": "azure",
"blob.core.windows.net": "azure_blob_storage",
Expand Down
2 changes: 1 addition & 1 deletion dist/whotracksme.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timeUpdated": "2023-10-22T00:09:43.045Z",
"timeUpdated": "2023-11-09T13:44:47.025Z",
"categories": {
"0": "audio_video_player",
"1": "comments",
Expand Down
9 changes: 6 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from 'fs';
import * as zod from 'zod';
import { consola } from 'consola';
import { stringify } from 'csv-stringify/sync';

const WHOTRACKSME_INPUT_PATH = 'source/whotracksme.json';
const WHOTRACKSME_COMPANIES_INPUT_PATH = 'source/whotracksme_companies.json';
Expand Down Expand Up @@ -291,14 +292,16 @@ function buildTrackersCSV(

Object.entries(trackersDomains).forEach(([domain, trackerId]) => {
const tracker = trackers[trackerId];

if (!tracker) {
throw new Error(`Tracker domain ${domain} has an invalid tracker ID: ${trackerId}`);
}

const { categoryId } = tracker;
if (typeof categoryId !== 'undefined') {
csv += `${domain};${trackerId};${categoryId}\n`;
const csvRow = stringify([[domain, trackerId, categoryId]], {
delimiter: ';',
quoted_match: ',',
});
csv += csvRow;
} else {
consola.warn(`Tracker ${trackerId} has no category ID, consider adding it`);
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"consola": "^3.1.0",
"csv-stringify": "^6.4.4",
"zod": "^3.21.4"
}
}
2 changes: 1 addition & 1 deletion source/companies.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"description": "Meta builds technologies that help people connect, find communities and grow businesses."
},
"microsoft": {
"name": "Microsoft",
"name": "Microsoft Corporation",
"websiteUrl": "https://www.microsoft.com/",
"description": "Microsoft is an American multinational corporation that develops, manufactures, licenses, supports, and sells a range of software products and services."
},
Expand Down
3 changes: 3 additions & 0 deletions source/trackers.json
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,10 @@
"amazontrust.com": "amazon_cdn",
"associates-amazon.com": "amazon_cdn",
"amazonpay.in": "amazon_payments",
"aiv-delivery.net": "amazon_video",
"amazonvideo.com": "amazon_video",
"pv-cdn.net": "amazon_video",
"primevideo.com": "amazon_video",
"appcenter.ms": "appcenter",
"aaplimg.com": "apple",
"apple-cloudkit.com": "apple",
Expand Down Expand Up @@ -1130,6 +1132,7 @@
"jira.com": "atlassian.net",
"ss-inf.net": "atlassian.net",
"azure.com": "azure",
"azure.net": "azure",
"azurefd.net": "azure",
"trafficmanager.net": "azure",
"blob.core.windows.net": "azure_blob_storage",
Expand Down

0 comments on commit 26c17dd

Please sign in to comment.