Posting to Bluesky via the API from PHP – Part One

With all the uncertainty surrounding the future of X (née Twitter), I decided to take a look at Bluesky which somewhat ironically has its roots in Twitter where it was started as an internal project. Bluesky is still in beta and is invite-only. I worry about its long-term given that ultimately it too has to make money, something that Twitter has singularly failed to do. None of this, of course, affects the topic today which is posting to Bluesky via the API.

Basic Concepts

The first thing to say is that I am using the following library to actually post … Read the rest

PiHuts Maker Advent Calendar “unboxing” Video 2023

Last year for the first time PiHut released an advent calendar called “The 12 Projects of Codemas!” which included 12 projects based around a Pico covering such things as temperature sensors, switches and the like. I did a series of unboxing and project videos covering their content. I had great fun so I was pleased to see that PiHut have brought them back for this year too.

This time there are not one but two advent calendars to get stuck into. This year alongside “The 12 Projects of Codemas!” is a second one called “Let it Read the rest

Simple Remote Wake on Lan with Raspberry Pi Zero W

As part of my drive to help the planet, I am trying to use less electricity. We have a Windows machine in the lounge that acts as a Plex media server. This works very well but I realised that it was only being used at certain times of the day, usually in the evenings, meaning that it was running for hours on end unnecessarily. Therefore, the plan was to have the machine automatically turn off each night at midnight when I knew we would definitely not be using it, but what about turning it on?

If I was at home … 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

Update to WordPress Posts to PDF

A few weeks ago I released a tool that allows you to export your WordPress posts to a nicely formatted PDF file. I have today pushed some changes to the code which you can find on the GitHub page. This includes the following:

  • Heading (H1, H2 & H3) tags are all now supported
  • List (ordered & unordered) tags are now supported
  • Inline images (not supported) captions are silently dropped
  • A new command line parameter to choose the order of output
  • Progress now shows the number of posts out of the total processed (see image below)
  • Improvements in the
Read the rest

Creating a Word Cloud from Your Day One Entries

A while back I wrote a post about querying the Day One database in which I teased more to come with this statement:

I wanted more detail than Day One offered and had ideas of how I could mine my entries in cool ways (more on that in a later post).

Well, this is that “later post”! I wanted to visualise my entries as a word cloud.

Massaging the data

In order to produce the cloud I needed to do two things: extract the data and then display it. Sounds simple doesn’t it? I quickly found that there were a … 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

Sending messages to Pushover from PHP

One of the things that I regularly bake into my own applications is notifications of when things go really bad and need my immediate attention. For this, I use the excellent and simple Pushover service which allows me to send a push notification to my mobile device. In this post, I run through how to set up your application in Pushover and then send a notification via PHP.

Setup Pushover

I am assuming that you have already created your Pushover account. You get a 30-day trial and after that, it is just $5 as a one-off purchase.

From your dashboard … 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

More Twitter API Shenanigans

Since Elon Musk took over Twitter things have been, how can I put this politely, a little unstable. Then, last Friday, the platform started to limit the number of Tweets that you can view. At the same time that this change was implemented my calls to the API stopped working returning the following:

stdClass Object (
   [errors] =Array (
      [0] =stdClass Object (
         [message] =Sorry, that page does not exist
         [code] =34
      )
   )
) 

Searching online turned up nothing much about this specifc error message and nothing recent either. I spent a bit of … Read the rest