Skip to content

Instantly share code, notes, and snippets.

@sneumann
Last active August 6, 2025 07:53
Show Gist options
  • Save sneumann/acc940e86ca2a18cd67fd0943982ef5d to your computer and use it in GitHub Desktop.
Save sneumann/acc940e86ca2a18cd67fd0943982ef5d to your computer and use it in GitHub Desktop.
Get number of NFDI4Chem.de followers on Bluesky (shell)
#!/bin/bash
did="did:plc:oxbo2ifc5i7shah4bvai2pbi"
cursor=""
total=0
while true; do
url="https://public.api.bsky.app/xrpc/app.bsky.graph.getFollowers?actor=$did"
if [ -n "$cursor" ]; then
url="$url&cursor=$cursor"
fi
response=$(curl -s "$url")
count=$(echo "$response" | jq '.followers | length')
total=$((total + count))
cursor=$(echo "$response" | jq -r '.cursor // empty')
[ -z "$cursor" ] && break
done
echo "Total followers: $total"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment