Preparing and Adding a new Project to git

I always struggle when I am ready to push my first commit to a new repository and always end up with errors, so I thought I would document the process here as an aide memoir for me and, hopefully, others will find it useful too.

Prerequisites

These instructions are for when you have already got a folder of code that you want to commit for the first time to git. The first thing to do is to create and setup your .gitignore file. This tells git which files to exclude when uploading. Things to include here are config files with … 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

jolpica2ergast F1 Database Updater

In addition to this blog and my personal blog I also maintain a Williams Racing fan site at https://williamsdb.com. In fact, this is my longest running site having first gone live on 6th May 1996. As you can imagine this has gone through a number of itterations over the years and the latest makes extensive use of a results database called Ergast.

And then it was gone

About a year ago the maintainer of Ergast announced that he was going to discontinue updating it at the end of 2024. To be honest, I don’t blame him as it … Read the rest

What Should I Play next?

I’ve got a lot of records (At the time of writing 1,076 Discogs tells me) and I always seem to gravitate to the same ones. I decided I needed help to selecting something to play so I wrote Now Playing to help guide me.

The Discogs API

Like many, I record details of my collection on the online service Discogs, which contains a user-generated database of audio releases in whatever format they are or were available. It also has an API that allows you to access certain information that is held within its database. If you are authenticated that … Read the rest

Where’s Santa?

I had an unusual request from my friend John recently – could I help him map the location of Santa as he goes about his deliveries? Ok, it wasn’t quite like that. He is a member of the Lions, and every December they take out a sleigh with Santa on the back through the streets to the delight of lots of excitable children. The issue was that parents didn’t know exactly when he was going to appear in their streets and were constantly looking and waiting for his arrival. If there was a map of the live position, this would … 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

Computer Education in Schools in the 2020s

A little while ago I wrote about my computing education growing up in the 1980s where I learned CECIL before progressing on to BASIC. Now, some 40 years later, I am discovering what computing children are being taught.

Enter Code Club

I had decided that once I retired, I wanted to give something back to the community, and using my core computing skills seemed like an obvious place to start.

I’d seen that the Raspberry Pi Foundation ran something called Code Club which aims to teach development skills to children from about aged five and up. These are mostly run … 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