1
0
mirror of git://jb55.com/damus synced 2024-09-16 10:13:45 +00:00
damus/devtools/fetch-popular-users
2023-05-24 18:26:18 -07:00

9 lines
500 B
Bash
Executable File

#!/usr/bin/env bash
set -e
curl $(curl -s 'https://storage.googleapis.com/storage/v1/b/nostrdb-backups/o?prefix=ndjson' | jq -r '.items | last | .mediaLink') > nostr-directory.json
jq -rc '.data | {url: .profileImageUrl, pk: .hexPubKey, userName: .userName, twitterFollowers: .user.followers_count, nostrFollowers: .nFollowerCount}' nostr-directory.json | jq -cs 'sort_by(.twitterFollowers + .nostrFollowers) | .[]' | tail -n1000 | tac > popular_users.json
printf "saved popular_users.json\n" >&2