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

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 media or websites. They are primarily used for accessibility and SEO purposes. Here’s what they do:

1. Accessibility

  • ALT text helps visually impaired users understand the content of images through
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

Using Cursor to Generate Code

I have written about the use of AI in programming previously but I recently came across Cursor which is Visual Studio Code with AI built in so I thought I would give it a go but what to do?

Road Trip

I have recently returned from a driving holiday around the East Coast of the US and was, as ever, amazed at the price of petrol (“gas”) compared to the UK but how much cheaper was it? I decided that this would make a simple test for Cursor.

As always, what is important is the prompt you give the AI … 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

Automatically Restarting Unresponsive MySQL Service

This blog and others that I run are all hosted on a cloud server with MySQL installed locally. Occasionally MySQL becomes unresponsive and I have to login to the server to kick it back into life by restarting msqld.

The most likely reason for MySQL becoming unresponsive is lack of resources so the best solution would be to increase the size of the server – however, that requires money that I don’t want to spend. Therefore, the next best option was to write a script to detect when MySQL was unavailable. Enter mysqladmin.

mysqladmin — A MySQL Server Administration Program

Read the rest

Working out my credit card statement date in Excel

This might be the most niche post I have ever done but I hope that it might prove useful to someone.

My credit card bill gets made up on or around the tenth of each month but, for reasons I won’t go into here, I needed to much more accurately predict when it was actually going to be created. Through a combination of searching and testing, I discovered that in my case it is always made up on the sixth working day of the month. Turns out that there is an Excel (and Google Sheets) function that can help with … Read the rest

Exporting all WordPress Posts to PDF

I had a requirement to export all my WordPress blog posts into a nicely formatted PDF file and so I looked at plugins that were available to do the job, of which there are a few. I tried some and none worked for me giving no output at all so I decided I would roll my own. Here’s how you can use that code to download your posts to PDF too. You can see an example of the output at the bottom of the post.

To do this required two things: accessing my posts via the WordPress API and … Read the rest

Day One Encryption

TL;DR the Day One local database is not encrypted.

After my last post on querying the Day One database, I was asked the question: what happens if you have your journals encrypted?

Before we get into that, let’s look at the Day One encryption options. You can turn on encryption on a journal-by-journal basis and it is on by default. This must have changed at some point as my original journal is not encrypted and newer ones are. Despite being able to choose which journals are encrypted and which aren’t selectively there is only one encryption key meaning that … Read the rest

The Move from LastPass is Complete

In December 2022 LastPass announced to their users that they had been subject to a data breach. This led me to consider moving to another password manager which I did, settling on 1Password.

I transferred over 1,700 passwords and I calculated that changing an average of three a day was going to take me a year and a half to change them all. Well, it has been somewhat quicker than that as I have finished! In doing so I have reduced the number from 1,700 to 677.

I thought that it might be useful to know what I did … Read the rest

Querying the Day One Database

WARNING! Make a copy of your database before trying any of this!

Why do it?

I have been using the Day One journaling app to keep a daily personal diary for many years now. I have been recording my mundane thoughts there for over seven years and have transcribed five paper diaries too giving me a total of 14 year held there.

That’s currently 4,267 entries and counting of which I know very little about other than the text itself. I wanted more detail than Day One offered and had ideas of how I could mine my entries in … Read the rest