Created
November 18, 2024 09:41
-
-
Save richinseattle/658ece0bfdbeeaab42481015918a2447 to your computer and use it in GitHub Desktop.
Cache all Bluesky DID -> Handle mappings
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
while true; do timeout 5 websocat "wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post" | grep '"handle"' > /tmp/jetstream.log 2>/dev/null | grep -v Terminated ; head -n -1 /tmp/jetstream.log | jq '.identity | .did, .handle | values' | tr -d '"' | paste -d " " - - | while read did handle; do echo -e "$did -> $handle"; redis-cli SET $handle $did > /dev/null ; redis-cli SET $did $handle > /dev/null; done ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment