Last active
February 2, 2023 00:34
-
-
Save angdraug/da8716259dbeb47fcae8ff93f2c0dbb1 to your computer and use it in GitHub Desktop.
Scan and import FediBlock domain block list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set TOKEN following steps in https://docs.joinmastodon.org/client/authorized/ | |
$SERVER=$1 | |
tr , ' ' | \ | |
while read DOMAIN SEVERITY COMMENT; do | |
curl -H "Authorization: Bearer $TOKEN" \ | |
-F domain=$DOMAIN \ | |
-F severity=$SEVERITY \ | |
-F public_comment="$PUBLIC_COMMENT" \ | |
https://$SERVER/api/v1/admin/domain_blocks | |
sleep 0.1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -s https://joinfediverse.wiki/FediBlock | \ | |
pup '.wikitable:nth-of-type(n+2) tr :nth-child(1) text{}' | \ | |
fgrep . | \ | |
while read DOMAIN; do | |
echo ${DOMAIN},suspend,Imported from FediBlock | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment