Skip to content

Instantly share code, notes, and snippets.

@bdd
Created December 12, 2022 08:22
Show Gist options
  • Save bdd/e3681c42f20aff06a2ea2c11e8317126 to your computer and use it in GitHub Desktop.
Save bdd/e3681c42f20aff06a2ea2c11e8317126 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
(($# == 2)) || (echo "usage: $0 <instance> <user>" >&2; exit 64)
instance=$1 user=$2
next="https://${instance}/users/${user}/followers?page=1"
while [[ ${next} != "null" ]]; do
readarray -t urls < <(
curl -SsfH 'accept: application/activity+json' "${next}" \
| jq -r '.next, .orderedItems[]'
)
next="${urls[0]}"
printf "%s\n" "${urls[@]:1}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment