Member-only story
Building a Perl Module for Posting to Bluesky Social
The new social media network is growing by leaps and bounds. Learning to post to it with Perl offers lessons useful to coders of all languages.

The new social network Bluesky Social has made quite a splash as Twitter continues its irresistible slide and users seek the latest in a series of friendly boltholes. Making automated posts to social media is an important part of my various business ventures, so I wanted teach myself how to build a Bluesky bot and get my feeds up and running there as quickly as possible.
Bluesky Social runs on the open-source Authenticated Transfer (AT) Protocol. The documentation is very thorough, but it’s a lot to plow through when all you really want to do is learn how to use the API to make a simple post. Because I’m old and do most of my work in Perl, I hoped there might be CPAN module that would nicely encapsulate the API, like there is for Mastodon. I couldn’t find one.
Fortunately, there is a Typescript implementation of the AT Protocol API, among other community projects, and I was able find one or two bits of sample code I could use to get my Perl implementation started. Though this tutorial presumes a working knowledge of Perl, coders of all languages should be able to use what I’ve worked out below to help get Bluesky bots up and running. (But benign bots only, please!)
Before we go on, please bear in mind that this is a quick and dirty implementation of a limited number of functions from the API. I will point out here and there where I would do things differently if I were creating a full implementation suitable for, say, distribution via CPAN.
Getting access to Bluesky
Of course, the first step to building a Bluesky bot is having an account on Bluesky Social for it to post to. If you don’t have one already, you’ll need an invitation code. For that you can either hit up an acquaintance (which is what I did) or join the waitlist. This early in the network’s life, I’m afraid there’s no way around this step.