Created
July 15, 2019 12:18
-
-
Save konarkmodi/64a6eb9748041c502ebf528b0e858dc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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