I wrote a moderately popular post on Mastodon. Lots of people shared it. Is it possible to find out how many different ActivityPub servers it went to? Yes! As we all know, the Fediverse is one big chain mail. I don't mean that in a derogatory way. When I write a post, it appears on my server (called an "instance" in Mastodon-speak). Everyone on my instance can see my post. My instance looks …
Continue reading →
The Selenium WebDriver is a brilliant way to programmatically interact with websites. You can write little Python scripts which can click around inside browser windows and do "stuff". I use it to download a file generated by a Javascript Blob and automatically save it to disk. Here's how. Set up the WebDriver After you've installed Selenium and the Chrome WebDriver, this is the standard…
Continue reading →
This is ridiculously niche. If this is of help to anyone other than to me... please shout! The IntenseDebate comment system is slowly dying. It hasn't received any updates from Automattic for years. Recently it stopped being able to let users submit new comments. So I've switched to Commentics which is a self-hosted PHP / MySQL comment system. It's lightweight, pretty good at respecting users'…
Continue reading →
Disclaimer! Work In Progress! See source code. I recently read this wonderful blog post about using 17th Century Dutch fonts on the web. And, because I'm an idiot, I decided to try and build something similar using Shakespeare's first folio as a template. Now, before setting off on a journey, it is worth seeing if anyone else has tried this before. I found David Pustansky's First Folio Font.…
Continue reading →
I'm a big fan of Untappd. It's a social drinking app which lets you check in to a beer and rate it. Look, we all need hobbies, mine is drinking cider. You can see a list of everything I've drunk over the 13 last years. Nearly 900 different pints! After checking in, the app automatically posts to Twitter. But who wants to prop up Alan's failing empire? Not me! So here's some quick code to…
Continue reading →
The social network service "Mastodon" allows people to publish posts. People can reply to those posts. Other people can reply to those replies - and so on. What does that look like in the API? Here's a quick guide to the concepts you need to know - and some code to help you visualise conversations. When you scroll through the website, you normally see a list of replies. It looks like this: …
Continue reading →
Two years ago to the day, I built Twistory - a service for seeing what you posted on Twitter on this day in previous years. If you've ever used Facebook, you'll know how it is supposed to work. You see posts which show that exactly 5 years ago you were starting a new job, 6 years ago you were at a wedding, etc. The Twitter version never really worked properly because the Twitter API doesn't…
Continue reading →
I'm doing an apprenticeship MSc in Digital Technology. In the spirit of openness, I'm blogging my research and my assignments. This is my paper from the PP1 module - where I take some CPD related to my profession. I picked Machine Learning in Python. I've blogged about the course itself. The middle two parts of this paper are about that - why I chose it and how I put it into practice. The…
Continue reading →
As part of my MSc I'm taking a short course in Practical Machine Learning via QA.com. The first three days were just about basic stats visualisation using Python. It was great to have a refresher - but I would have expected that to be a pre-requisite. The tutor was excellent - very patient at explaining complex concepts. And the use of Jupyter Notebooks is a gamechanger for taught courses like…
Continue reading →
Scratching my own itch. I want an alert when there's been a price drop on an item on my Amazon wishlist. I couldn't find an easy way to get an email directly from Amazon (customer-focused my shiny metal arse) so I knocked something up in Python. This is heavily inspired by Leigh Dodds' Wishlist Monitor. Amazon don't offer an API for wishlists (innovative my shiny metal arse). So this uses…
Continue reading →
Way back in 2010, Paul Battley was blogging about device discrimination on the Internet. The new iPlayer service was using TLS certificates to ensure that only specific devices were able to stream media from the BBC's servers. That's a situation which continues over a decade later. If you watch iPlayer on your laptop, you're stuck with 720p quality. If you want 1080p and above, you need a…
Continue reading →
I recently had cause to take a beginners course in R - a language I'm fairly familiar with. One of the other students had never used it before, so we were buddied up in order for me to show them the ropes. The first lesson of R is always the same. Read a CSV, manipulate it a bit, draw a graph. We did it all without much fuss - and a graph appeared on screen. Nifty! "I don't get it," the…
Continue reading →