Created
December 12, 2022 08:22
-
-
Save bdd/e3681c42f20aff06a2ea2c11e8317126 to your computer and use it in GitHub Desktop.
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
#!/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