basic bitch obfuscation of email, telephone

This commit is contained in:
bel
2023-10-18 21:55:07 -06:00
parent 62885e3b63
commit 0d36f5b7da
3 changed files with 20 additions and 8 deletions

View File

@@ -7,11 +7,23 @@ if ! which gojq; then
go install github.com/itchyny/gojq@latest
fi &> /dev/null
html_escape_str() {
local str="$1"
for i in $(seq 0 $(("${#str}"-1))); do
LC_CTYPE=C printf '&#%d;' "'"${1:i:1}
done
}
html_escape_str contact@blapointe.com
while sleep 1; do
date
cat ./homebrew.yaml \
| sed "s/@/$(html_escape_str @ | sed 's/\&/\\\&/g')/g" \
| sed "s/mailto:/$(html_escape_str mailto: | sed 's/\&/\\\&/g')/g" \
| sed "s/tel:/$(html_escape_str tel: | sed 's/\&/\\\&/g')/g" \
| gojq --yaml-input . \
| tpl --file homebrew.tmpl \
> ./homebrew.html
| tee ./homebrew.html \
> /dev/null
date
done