Handling unicode and missing link card images in php2Bluesky

I have just committed a couple of changes to my php2Bluesky library. This release includes a simple change to enable the support of international characters in hashtags and a more complex (to explain) change to the options for link cards.

International support

This was a change to the regex used in the library to identify the start and end points of hashtags. The previous code used /#(w+)/ which matches only Alphanumeric characters: [A-Za-z0-9] and an underscore _. This meant that hastags such as #Gütersloh failed to be recognised correctly. Now the regex is /#([\p{L}\p{N}]{1,})/ this now supports:

  • Latin
Read the rest

An update to php2Bluesky

I’ve just committed a couple of changes to my php2Bluesky library based on suggestions and/or code provided by others. These are:

  1. new function, permalink_from_response, which will return a permalink given the response from post_to_bluesky (@BobaFettFanClub)
  2. you can now provide your own image for a link card just include the link in post_to_bluesky (@bearlydoug)
  3. start of some error checking

Clearing Some Confusion

I have also received some feedback that the blog posts written when I was first investigating posting to Bluesky are confusing if you are only looking to be able to use the library itself. Looking … Read the rest

Posting to Bluesky via the API from PHP – Part Ten – Adding ALT tags to Images

NOTE: This post is mainly about how I developed the php2Bluesky library. If you are looking for information on using the library in your own code please see here: https://github.com/williamsdb/php2Bluesky/

I have to admit that I didn’t think I’d be back with another post on my php2Bluesky library quite so soon but Dr Paul Lee on Bluesky pointed out that while you can post images from the library you can’t also send ALT text to go with them.

But what is ALT text?

Alt text is descriptions of images added to the HTML or metadata of a post on social … Read the rest

Posting to Bluesky via the API from PHP – Part Nine – Handling Hashtags

Bluesky has gone from a very niche platform to one that is getting more coverage and seeing explosive growth thanks in part to the actions of the overlord at Twitter. The following was the count of users when I wrote this post.

Expanding functionality

At the same time as the user growth, the platform itself has been growing features to bring it more in line with what its competitors are offering. This includes hashtags, which are now fully supported both in the app and API. What this also means is that I can now add support for … Read the rest

A Minor Update to my Bluesky Library

A quick post to say that my Bluesky library has had a small update. This is to take into account that from version two of Clark’s library that handles the calls to Bluesky the connection method has changed. Therefore, if you have updated to version two then remember also to update the PHP2Bluesky code which can be found here.

You can read all the posts on the PHP2Bluesky library here and get in touch if you find any issues or have an enhancement suggestion.… Read the rest

Posting to Bluesky via the API from PHP – Part Eight – Retrieving a Post

NOTE: This post is mainly about how I developed the php2Bluesky library. If you are looking for information on using the library in your own code please see here: https://github.com/williamsdb/php2Bluesky/

Once again I have been looking at the Bluesky API as part of a question posted on my Github respository. This time the question was “Can I specify one URL and use PHP to retrieve only one bluesky post by someone else?”. You don’t actually need my library to do that but I thought it would be useful to post details here as it’s not immediately obvious.

Identifying an

Read the rest

Posting to Bluesky via the API from PHP – Part Seven – Handling Multiple Images

NOTE: This post is mainly about how I developed the php2Bluesky library. If you are looking for information on using the library in your own code please see here: https://github.com/williamsdb/php2Bluesky/

It really is very gratifying when people use your code in their own projects and get in touch to ask questions, suggest changes or, heaven forbid, highlight bugs! Yesterday, someone raised an issue asking if it was possible to upload four images to a post. Let’s take a look and see…

Who Wants Multiple Images Anyway?

To be honest, when I wrote PHP2Bluesky it was very much for my own … Read the rest

Posting to Bluesky via the API from PHP – Part Six – Handling Handles and Oversized Images

NOTE: This post is mainly about how I developed the php2Bluesky library. If you are looking for information on using the library in your own code please see here: https://github.com/williamsdb/php2Bluesky/

I wrote a series of posts towards the end of the year that took you step-by-step through using the Bluesky API to post to the social network. Having used the code Patrick Delahanty got in touch to say that he had found a couple of issues. Firstly, handling user handles and secondly dealing with large images. Let’s take a look at both of those.

Handling User Handles

As with … Read the rest

Changing your Bluesky handle to be your own domain

I’m liking Bluesky, which is a little like a rough around the edges X without the toxicity found there. And here’s a neat thing you can do on Bluesky that you can’t on X. If you have your own domain you can use that as your Bluesky handle. In the rest of this article, we’re going to look at how you do that.

Why would you want to do it?

First off why would you want to do so and what are the implications of making the change? I see a number of reasons to make the change:

  1. it
Read the rest

Posting to Bluesky via the API from PHP – Part Five – Putting it all Together

NOTE: This post is mainly about how I developed the php2Bluesky library. If you are looking for information on using the library in your own code please see here: https://github.com/williamsdb/php2Bluesky/

In this series of posts we have looked at:

In this final post we are looking at putting it all together. This includes a worked example plus a complete library of functions that will allow you to easily interact with the Bluesky API.

The Prerequisites

What this project has predominately been about is the correct formatting … Read the rest