Badge Request - Dynamic Bluesky Badges for Users
📋 Description
Mostly as another variation on a social follower/post count badges similar to other services.
Utilizing the static generator for a personal examples:
Possible follower example:
Possible post count example:
I can see some use with a badge for a specific feed as well, but I have not looked into this matter deeply enough to give a confident use case.
🔗 Data
The Bluesky API for this data is publicly available and accessible with no API keys.
The documentation is available on docs.bsky.app as app-bsky-actor-get-profile.
It seems that just using https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile/?actor=[HANDLE / DID] is all that's needed for the required data as JSON, accessible with the keys followersCount and postsCount for the examples I gave above. The usage of the handle key can be used as the username of the account in the badge.
Only main issue I can foresee is handles changing, but that can be resolved by using the DID of the user, which for convenience can be captured at the time with the did key.
🎤 Motivation
More social badges would be helpful, especially for people who operate either solely or majorly on Bluesky over other services. I can see this being used on GitHub accounts' README.md as a social media tie, and generally used as a way to encourage support of developers and projects outside of GitHub, Bitbucket, any other Git repository service, or webpage in general.
As a personal motivation, Bluesky is my only main social media platform I actively use, but I know that the developer presence on Bluesky is generally substantial.
Raw URL, since GitHub caches images and I can't see the dynamic JSON URL you've used.
https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Dcad.cx&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40cad.cx
yields
@chris48s Can I take this on?
Feel free. I will aim to pick up a review for you