summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2026-09-30 20:31:56 -0400
committerJune McEnroe <june@causal.agency>2026-09-30 20:31:56 -0400
commit06ac3a49a0321c74580b4b2b89b741650f658cad (patch)
treed45b7d6fdef418e77b6af704da0b7885a371afe1
parentAdd The Fortunate Fall (diff)
downloadsrc-master.tar.gz
src-master.zip
Allow more pronoun updates HEAD master
-rw-r--r--etc/pronouns/bot.sh28
1 files changed, 25 insertions, 3 deletions
diff --git a/etc/pronouns/bot.sh b/etc/pronouns/bot.sh
index 8b7c9802..13ddb239 100644
--- a/etc/pronouns/bot.sh
+++ b/etc/pronouns/bot.sh
@@ -2,6 +2,13 @@
 set -eu
 
 Instance=https://mstdn.isometry.group
+Allowed='
+	campfi.rs
+	mtl.rocks
+	multiocular.ooo
+	quiet.horse
+	social.implicitmatrix.com
+'
 
 if ! test -f access_token; then
 	echo 'No access_token!' >&2
@@ -31,7 +38,7 @@ followers=$(
 	curl -Ss \
 		-H "Authorization: Bearer ${access_token}" \
 		"${Instance}/api/v1/accounts/${account_id}/followers?limit=80" |
-	jq -r 'map(select(.acct | contains("@") | not)) | .[].id'
+	jq -r '.[].id'
 )
 
 for follower_id in $followers 112284333737697665; do
@@ -40,7 +47,22 @@ for follower_id in $followers 112284333737697665; do
 			-H "Authorization: Bearer ${access_token}" \
 			${Instance}/api/v1/accounts/${follower_id}
 	)
-	username=$(printf '%s' "${account}" | jq -r .username)
+	acct=$(printf '%s' "${account}" | jq -r .acct)
+	instance=${acct#*@}
+	allowed=false
+	if [ "$instance" = "$acct" ]; then
+		allowed=true
+	else
+		for allowed_instance in $Allowed; do
+			if [ "$instance" = "$allowed_instance" ]; then
+				allowed=true
+				break
+			fi
+		done
+	fi
+	if ! $allowed; then
+		continue
+	fi
 	pronouns=$(
 		printf '%s' "${account}" |
 		jq -r '
@@ -61,7 +83,7 @@ for follower_id in $followers 112284333737697665; do
 				-H "Authorization: Bearer ${access_token}" \
 				-F visibility=unlisted \
 				--form-string \
-				"status=@${username} has changed pronouns to: ${text}" \
+				"status=@${acct} has changed pronouns to: ${text}" \
 				${Instance}/api/v1/statuses >/dev/null
 		fi
 		printf '%s' "${pronouns}" >$follower_id
low=1'>New mailing list.Jason A. Donenfeld 2013-04-30ui-snapshot: do not access $HOMEJason A. Donenfeld 2013-04-27t0001: validate Git -rcN version numbers correctlyJohn Keeping 2013-04-27git: update to 1.8.2.2John Keeping 2013-04-17scan-tree: fix regression in section-from-path=-1John Keeping 2013-04-15t0001: ignore ".dirty" suffix on Git versionJohn Keeping 2013-04-15tests: set TEST_OUTPUT_DIRECTORY to the CGit test directoryJohn Keeping 2013-04-15t0109: test more URLsJohn Keeping 2013-04-10cgitrc.5.txt: Specify when scan-path must be defined before.Jason A. Donenfeld 2013-04-10ui-snapshot.c: Prepend "V" when guessing ref namesLukas Fleischer 2013-04-10t0107: Skip ZIP tests if unzip(1) isn't availableLukas Fleischer 2013-04-10tests/: Do not use `sed -i`Lukas Fleischer 2013-04-10Add branch-sort and repo.branch-sort options.Jason A. Donenfeld 2013-04-10t0109: chain operations with &&John Keeping 2013-04-10cgit.c: Do not restore unset environment variablesLukas Fleischer 2013-04-09t0107: Use `tar -z` for gzip'ed archivesLukas Fleischer