Zum Inhalt springen

Connect Bluesky and MAKE.com for new posts

EDIT: Links do not work this way. You have to mark them in a special way. I’ll explain this in a second blog post.

I have just added a Bluesky account for my project BarcampListe.de. It is a list of all Barcamps in the German speaking area. Every new entry is automatically published to several social media accounts (LinkedIn, Facebook, Mastodon, X) using the no code platform MAKE.com*. Unfortunatly there is no integration for Bluesky in MAKE.com at the moment. So I read the API documentation and found a way relative simple way to create Bluesky posts from MAKE.com.

In MAKE.com I use something like functions to create more robust and flexible scenarios. It is also much easier to reuse parts of your scenarios. The following example is one of five „subroutines“ I use in this scenario. (The use of these „subroutines“ might be something for another blog post…)

First of all, you need a Bluesky account. Log in and go to „Settings“ and then „App passwords“ to open this page. There click on the button „Add App Password„, assign a name and store the secure password provided in the next step. It can’t be displayed again – don’t close the dialog too quickly!

With this password we can create our connection to Bluesky in MAKE.com:

Yes, you might want to add more error handlers…

The scenario basically takes one input: This is the content for the post. You could also add the posting date and time as a second input. I don’t need this because all my posts are published immediately. In my case, the second input is an ID from the data store where I store the URL of the Bluesky post or an error message.

In the first module, we need to connect to Bluesky to create a session with our username and password. We use an HTTP request module to do this:

Use the following settings in the module:

  • URL: https://bsky.social/xrpc/com.atproto.server.createSession (This may change depending on your Blusesky server. As far as I know, this is the only one at the moment. But new servers might be offered.)
  • Method: POST
  • Body: Raw
  • Content type: JSON
  • Request content: {„identifier“: „USERNAME.bsky.social“, „password“: „xxx-xxx-xxx“} (Enter your username and the app password here. Do not use your regular user password.)

Next we parse the JSON response from Bluesky. Simply add a JSON parser module with the output from the first module:

In the response we will find a token called „accessJwt“. We will need this for further authentication.

With this preparation we can add the module that will be used for the Bluesky posting itself. This is another HTTP module:

Use the following values in this module:

  • URL: https://bsky.social/xrpc/com.atproto.repo.createRecord (Again, the URL may change if you are using a different server).
  • Method: POST
  • Header: „Authorization“ with value „Bearer [accessJwt Token from previous module]“
  • Body type: Raw
  • Content type: JSON
  • Request:
    Attention: You may need to change „now“ to a different date!
{
  "repo": "[did VALUE FROM previous module]",
  "collection": "app.bsky.feed.post",
  "record": {
      "$type": "app.bsky.feed.post",
      "text": "This is your post text",
      "createdAt": "{{now}}"
  }
}

The answer has to be parsed with the MAKE.com JSON parser and will return a „uri“ value.

Now we can fetch a part for the post URL from this uri field by using a regular expression:

All you need is the value after the last slash in the uri, which you can get using the following regular expression:

.*\/(?<urlpart>[a-z0-9]+)

Finally we use this value to get the public URL for the post. In my scenario I write this URL to a date store but you can use it in other modules as well:

You can see from the example that the final URL is „https://bsky.app/profile/barcampliste.bsky.social/post/“ followed by the URL part we got in the last module.

In my case the first post (after some testing) was this one announcing a barcamp on the 17 SDGs: https://bsky.app/profile/barcampliste.bsky.social/post/3kctlh6msfq2j

DONE! 🙂

You want to do more? Here is the API documentation. I’ll add another blog post about adding links because the link in the example below is not visible.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert