Skip to content

Instantly share code, notes, and snippets.

@benharri
Last active May 24, 2023 18:01
Show Gist options
  • Save benharri/27a91c02c22ad020cb34f2bfd47f234c to your computer and use it in GitHub Desktop.
Save benharri/27a91c02c22ad020cb34f2bfd47f234c to your computer and use it in GitHub Desktop.
#!/bin/sh
handle=benharr.is
password=xxxx-xxxx-xxxx-xxxx
token=$(curl -s \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary "{\"identifier\": \"$handle\", \"password\": \"$password\"}" \
https://bsky.social/xrpc/com.atproto.server.createSession \
| jq -j ".accessJwt")
exec curl -s \
-H "Authorization: Bearer $token" \
"https://bsky.social/xrpc/com.atproto.server.getAccountInviteCodes" \
| jq -r '.codes[].uses[].usedBy' \
| xargs -I{} -P10 curl -s 'https://plc.directory/{}' \
| jq -r '.alsoKnownAs[0]' \
| sed -e 's#at://#@#'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment