Using php2Bluesky without Composer post v2.0.14

In January I wrote about Using php2Bluesky without Composer for those that wanted to take this approach. Since then I have updated the code so that it conforms to PSR-4 for loading with Composer. This in turn has a knock-on effect for those loading manually. The rest of this article explains how loading now needs to take place.

Multiple Files

Prior to v2.0.14 all the code was contained within a single file called functions.php. The naming reflected the history of the library which was originally developed to be included as part of a larger project. When I spun it out … Read the rest

Using php2Bluesky without Composer

I have been asked how to use my php2Bluesky library without having to install it using Composer. Given that this is a common request I thought that I would document it here.

Pros and Cons of Composer

Before we get into the specifics of using php2Bluesky without Composer let’s take a quick look at the pros and cons of using Composer. Feel free to skip this bit and go straight to how to use php2Bluesky without Composer!

Using Composer to install a package has several advantages over manually downloading the code and requiring it. Composer automates dependency management, … Read the rest

Introducing v2 of php2Bluesky

There was an issue raised recently on my php2Bluesky library pointing out that the dimensions of images weren’t being passed and so they weren’t being displayed on Bluesky correctly. On investigation, I found this to be correct, but because of the way the code was currently implemented, I couldn’t fix it. The library needed to have control of the upload of images in order to get the dimensions and currently that wasn’t the case.

Breaking Changes Incoming

The history of php2Bluesky is that it started as a series of functions in a larger side project I was working on. I … Read the rest

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