diff --git a/scripts/add-following-88x31s b/scripts/add-following-88x31s new file mode 100755 index 0000000..e1dd9d2 --- /dev/null +++ b/scripts/add-following-88x31s @@ -0,0 +1,7 @@ +toot following 0x6e6174 | cut -d' ' -f2 | while read -r account; do + url="$(toot whois $account | grep -i site -A1 | grep -E 'https?://')/.well-known/button.json"; + [ -n "${url}" ] && response="$(curl -s -o /dev/null -w '%{http_code}' "${url}")"; + [ "$response" -eq "200" ] && body="$(curl -s "${url}" | jq -r '.default as $default | .buttons[] | select(.id == $default) | "\"\(.alt)\""' 2>/dev/null)" + [ -n "${body}" ] && echo "${body}" > ./files/88x31/$(echo $url | sed 's/https:\/\///g; s/.well-known\/button.json//; s/\//-/g; s/.$//').html + body='' +done