2019-11-11 10:19:46 +00:00
#!/usr/bin/env bash
2019-12-07 17:45:48 +00:00
function log( ) {
echo -e " \033[33m $@ \033[0m "
}
2019-12-12 23:11:21 +00:00
log "Exporting lists…"
2019-12-13 07:23:38 +00:00
./export.py --first-party --output dist/firstparty-trackers.txt
./export.py --first-party --end-chain --output dist/firstparty-only-trackers.txt
./export.py --output dist/multiparty-trackers.txt
./export.py --end-chain --output dist/multiparty-only-trackers.txt
2019-12-05 18:15:24 +00:00
2019-12-13 07:23:38 +00:00
log "Generating hosts lists…"
2019-11-15 07:57:31 +00:00
function generate_hosts {
basename = " $1 "
description = " $2 "
2019-12-05 19:51:53 +00:00
description2 = " $3 "
2019-11-15 07:57:31 +00:00
(
echo "# First-party trackers host list"
echo " # $description "
2019-12-05 18:15:24 +00:00
echo " # $description2 "
2019-11-15 07:57:31 +00:00
echo "#"
echo "# About first-party trackers: https://git.frogeye.fr/geoffrey/eulaurarien#whats-a-first-party-tracker"
echo "# Source code: https://git.frogeye.fr/geoffrey/eulaurarien"
echo "#"
2019-12-03 20:45:29 +00:00
echo "# In case of false positives/negatives, or any other question,"
echo "# contact me the way you like: https://geoffrey.frogeye.fr"
echo "#"
2019-11-15 07:57:31 +00:00
echo "# Latest version:"
2019-12-05 18:15:24 +00:00
echo "# - First-party trackers : https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt"
echo "# - … excluding redirected: https://hostfiles.frogeye.fr/firstparty-only-trackers-hosts.txt"
echo "# - First and third party : https://hostfiles.frogeye.fr/multiparty-trackers-hosts.txt"
echo "# - … excluding redirected: https://hostfiles.frogeye.fr/multiparty-only-trackers-hosts.txt"
2019-12-13 07:23:38 +00:00
echo '# (you can remove `-hosts` to get the raw list)'
2019-11-15 07:57:31 +00:00
echo "#"
echo " # Generation date: $( date -Isec) "
2019-12-03 14:35:21 +00:00
echo " # Generation software: eulaurarien $( git describe --tags) "
2019-12-12 23:11:21 +00:00
echo "# Number of source websites: TODO"
echo "# Number of source subdomains: TODO"
2019-12-05 18:38:26 +00:00
echo "#"
2019-12-12 23:11:21 +00:00
echo "# Number of known first-party trackers: TODO"
2019-12-05 18:15:24 +00:00
echo " # Number of first-party subdomains: $( wc -l dist/firstparty-trackers.txt | cut -d' ' -f1) "
echo " # … excluding redirected: $( wc -l dist/firstparty-only-trackers.txt | cut -d' ' -f1) "
2019-12-05 18:38:26 +00:00
echo "#"
2019-12-12 23:11:21 +00:00
echo "# Number of known multi-party trackers: TODO"
2019-12-05 18:15:24 +00:00
echo " # Number of multi-party subdomains: $( wc -l dist/multiparty-trackers.txt | cut -d' ' -f1) "
echo " # … excluding redirected: $( wc -l dist/multiparty-only-trackers.txt | cut -d' ' -f1) "
2019-11-15 07:57:31 +00:00
echo
2019-12-13 07:23:38 +00:00
sed 's|^|0.0.0.0 |' " dist/ $basename .txt "
2019-11-15 07:57:31 +00:00
) > " dist/ $basename -hosts.txt "
}
2019-12-05 18:15:24 +00:00
generate_hosts "firstparty-trackers" "Generated from a curated list of first-party trackers" ""
generate_hosts "firstparty-only-trackers" "Generated from a curated list of first-party trackers" "Only contain the first chain of redirection."
generate_hosts "multiparty-trackers" "Generated from known third-party trackers." "Also contains trackers used as third-party."
generate_hosts "multiparty-only-trackers" "Generated from known third-party trackers." "Do not contain trackers used in third-party. Use in combination with third-party lists."