Generates a host list of first-party trackers for ad-blocking.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
604 B

  1. #!/usr/bin/env bash
  2. # Filter out the subdomains not pointing to a first-party tracker
  3. cat subdomains/*.list | sort -u > temp/all_subdomains.list
  4. ./filter_subdomains.py temp/all_subdomains.list > temp/all_toblock.list
  5. sort -u temp/all_toblock.list > dist/firstparty-trackers.txt
  6. # Format the blocklist so it can be used as a hostlist
  7. (
  8. echo "# First-party trackers"
  9. echo "# List generated on $(date -Isec) by eulaurarien $(git describe --tags --dirty)"
  10. cat dist/firstparty-trackers.txt | while read host;
  11. do
  12. echo "0.0.0.0 $host"
  13. done
  14. ) > dist/firstparty-trackers-hosts.txt