Skip to content

Instantly share code, notes, and snippets.

@shuxiao9058
Forked from ITJesse/Surge-Adblock
Created September 2, 2017 14:16
Show Gist options
  • Save shuxiao9058/18eace71626d89a5a2cd9499efd17b53 to your computer and use it in GitHub Desktop.
Save shuxiao9058/18eace71626d89a5a2cd9499efd17b53 to your computer and use it in GitHub Desktop.
curl http://blog.monstuff.com/ad-block-pac.js | \
grep dnsDomainIs | \
grep -v '//' | \
grep -v 'function' | \
awk -F '[""]' '{print $2}' | \
awk '$1 ~ /^\./ {printf "DOMAIN-SUFFIX,%s,ADBLOCK\n",substr($1,2)} $1 !~ /^\./ {printf "DOMAIN,%s,ADBLOCK\n",$1}' \
> adblock.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment