Skip to content

Instantly share code, notes, and snippets.

@konarkmodi
Created July 15, 2019 12:18
Show Gist options
  • Save konarkmodi/64a6eb9748041c502ebf528b0e858dc0 to your computer and use it in GitHub Desktop.
Save konarkmodi/64a6eb9748041c502ebf528b0e858dc0 to your computer and use it in GitHub Desktop.
# Make sure you run curl 'https://whotracks.me/data/trackerdb.json' > orig_whotracksme.json
import json
company_mapping = {}
f = json.loads(open('orig_whotracksme.json').read())
for tracker_name, details in f['trackers'].items():
company_id = details['company_id']
company_name = f['companies'].get(company_id, {'name': 'unknown'})['name']
for each_hostname in details['domains']:
company_mapping[each_hostname] = company_name
f = open('whotracksme.json', 'w')
f.write(json.dumps(company_mapping))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment