Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
echo 'return{'
for a in $(jq '.[].trigger["url-filter"]' disconnect-advertising.json |
cut -f3 -d? | sed 's:\\\\.:.:g' | sed s:\"::)
echo \"$a\",
echo '}'
) > blocklist.lua
Copy link

jangrewe commented May 15, 2019

A simpler(?) command: jq -r '.[].trigger["url-filter"]' disconnect-advertising.json | sed 's:.*?::; s:\\::g; s:/.*::'
Notice the -r argument for jq, that strips a lot of characters already.
Full script:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment