How I made an automated dynamic avatar for my Bluesky profile
February 5, 2025 10:00am EST
Several years ago, back when Twitter was a thing and it had a decent API, my friend @goose.art did a weird little experiment where he made his avatar dynamic... it automatically changed appearances on a regular basis and became increasingly deep-fried (increased in distortion and lossy compression). I've seen several other people mess around with this concept since then, and I've always had it in the back of my head as something I wanted to eventually try for myself.
Flash forward to today, and I've finally done exactly that thanks to Bluesky and its wonderful API.
Today I activated an automation that changes my Bluesky avatar every hour of each day to roughly correspond with the daylight (or lack thereof) that I'm experiencing in my time zone (EST). As the sun is rising and setting each day, you'll see it reflected on my profile in the form of ever-changing sky gradients. I felt that this expression was especially appropriate given the theme of the Bluesky brand.
In case anyone is wondering how this automation works under the surface, I thought it might be worthwhile to write up a blog post explaining my process. I'm sure all of the devs/engineers can deduce what's going on, but I think I implemented it in a pretty fun way that should be entertaining regardless of your skill level.
The Visuals and Concept
Ever since coming back to social media after a long break last year, my profile picture had just been my name in Arial font loosely in the style of Charli xcx's Brat album cover. I evolved the design of it overtime to be more my own style, and then I realized that it would work perfectly for this project. So, I began creating a bunch of interesting variants of the design in Adobe Illustrator.
The backgrounds are simple two-color gradients with noise filters applied and then styled with a gaussian blur. The variations of the word "dame" were made using numerous blending layers, strokes, and effects all smashed together in funky and disturbing ways.
After the fact, I realized that the visuals I produced had a taste of Ed Ruscha's style to them, an artist whose work I have long appreciated.
Artwork © Ed Ruscha. Photo: Rob McKeever
The "Code"
While I could have used a traditional cron job to schedule the changes each hour, that seemed pretty boring, and I have an affinity towards making Apple Shortcuts... so I challenged myself to go that route instead, which had the added benefit of letting me control things from wherever I happen to be thanks to the fact that I have my phone with me at all times.
There were several possible ways to implement the necessary API calls, and I tried several of them, but ultimately I landed on using a single dictionary full of the necessary CIDs for each image. Every hour the shortcut performs these steps:
- Queries the dictionary for the image CID corresponding to the current time.
- Authenticates my Bluesky account using an app password.
- Uses the API to fetch my profile's current data.
- Builds a POST request using the fetched profile data + the new avatar CID, before then sending it back via the putRecord endpoint.
- Checks that the data was updated correctly and notifies me if there was an error.
There's quite a bit of regex that was needed to properly match/filter JSON data, and I don't know regex, but luckily claude/chatgpt is very good at writing it for me.
The one surprise I had along the way was realizing that I couldn't just push one element of profile data through the API... I originally sent a test request through that just contained the avatar update, and quickly discovered that it "removed" my display name, banner, pinned post, and description because I didn't include those elements in the data I was pushing. That's why the Apple Shortcut includes the step of fetching the existing profile data, so that even though nothing else changes it can be fed back into the POST request along with the avatar update.
Here's a copy of the Apple Shortcut file if you're interested in looking at the "code" yourself or modifying it.
Future Updates and Ideas
I'd like to create a Version 2 of this project in a few weeks that adds some additional elements like logic paths and layers that display based on weather data (fog, rain, cloud cover, rare random events like shooting stars, etc). It would also be nice to automate my banner image to match the backgrounds of the avatar.
In addition to this automation, I also added a dynamic bio to my status update account (@now.dame.is) that includes regularly updated data about my current psychological state + environment (focus level, mood, current song, indoor temp, etc).
Using Apple Shortcuts to automate Bluesky data has a lot of interesting experimental potential thanks to the large number of automation triggers that Apple provides. Everything from sound recognition to whether or you're stationary or not... and don't even get me started with NFC tags. I hope we see more people trying weird things in the future.
Special shout out to @cagrimmett.com for sharing this template that saved me a bunch of time I would've spent trying to figure out how to setup the session/auth functions.
Comments