Posting to Bluesky via the API from PHP – Part Three – Links

So far we have looked at making a connection to Bluesky, posting text and images. In this post I want to look at how links are handled. Unlike X and Mastodon on Bluesky when you post text that includes one or more links these are not parsed and activated. You have to tell Bluesky that you have links in your text and where they are.

Parsing for Links

In order for links to be handled correctly by Bluesky in addition to the text itself you also need to pass an array as part of the parameters giving the start … Read the rest

Posting to Bluesky via the API from PHP – Part Two – Images

In the first of these posts we looked at creating the connection to the Bluesky API and posting a text post. In this second post we are going to extend that out to post images as well as text.

The code posted here are snippets from a larger library of functions that you can drop in and use to post to Bluesky. If some parts look more complex than they need to all will be revealed in the final version.

Uploading Images

In order to post an image to Bluesky you have to take a few steps:

  1. open and ingest
Read the rest

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

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

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

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

Transitioning from Twitter API v1.1 to v2 (Part 2)

In the first part of this post, I showed how to set up your Twitter dev account ready for using v2 of the API. In this post, I will show you how to access that API and post a tweet.

Goodbye Codebird

I am moving from Codebird which has been great but only supports v1.1 of the API. I looked at all the PHP libraries that I could find and decided on TwitterOAuth which styles itself as the “most popular PHP library for use with the Twitter OAuth REST API”. I toyed with this package but couldn’t get it … Read the rest

Transitioning from Twitter API v1.1 to v2 (Part 1)

As part of The Twitter Debacletm I have spent the last few weeks trying to get my Twitter bot working again which has taken quite a bit of effort.

I thought it might be worth looking at what I did to get my bot working again once access to the API was cut in February. As there is so much in this I have broken it down into two parts:

  1. setting up your project and getting the keys you require to use the API
  2. calling the API from PHP

Getting the keys

I struggled to find which keys to … Read the rest

The Twitter Debacle

Ever since Elon Musk took reluctant control of Twitter he has been walking a tightrope as he balances bringing Twitter into the black with not losing the core base of users. That includes laying off a large number of staff.

One decision that I think he might yet come to regret is the change to the API access moving from free access to a freemium model. Where you used to be able to post an unlimited number of tweets this is now restricted – 1,500 a month for the free account, 50,000 a month for $100 and so on up.… Read the rest

Hyper Local Weather Part 2 (It’s not that)

A while ago I wrote this article about the box installed on a lamppost down our road. I surmised that this was a local weather station providing hyper-local weather, but that is not the case. Read on to find out what it actually is…

I was surprised to see someone up a ladder tending to the contents of the box this week and so I decided to go and find out exactly what it was all about. The person was happy to chat and explained that he was from the Transport Research Laboratory, contracted to the … Read the rest