Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Using Selenium & Chrome to automatically download Blob files

· 350 words · Viewed ~1,820 times


Logo of the Python programming language.

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…

Getting WordPress / JetPack Subscriber Counts via the API... the hard way

· 450 words


The Logo for WordPress.

People can subscribe to receive my blog via email. This is managed by the JetPack plugin. I want to be able to display something like "Join 1,234 subscribers and receive updates via email". So, how do I get the subscriber count from the API? As documented in the JetPack HTTP API, it is possible to interact with JetPack programmatically. A good starting point is /wp-json/ - that will show you…

I think "Law 3.0" is OK, actually

· 12 comments · 1,100 words · Viewed ~268 times


An electric car charging at a public charger.

I recently came across a post about "The Energy Bill 2023 and the Fusion of Technology and Law - We are going to be governed under 'Law 3.0', and we won't like it one little bit". It is a superficial look at the "horrors" of being governed by technical measures. It starts off reasonably enough by describing the evolution of our legal system: Law 1.0 says "Thou shalt not kill". Law 2.0 says…

I think I kind of hate lazy loading

· 14 comments · 300 words · Viewed ~7,031 times


An icon representing a broken image.

Yesterday I was on a train. I clicked on a link and my browser loaded a long article for me to read. Halfway through reading it, the train went into a tunnel and I lost signal. That meant I couldn't see the images on the other half of the page for the rest of the journey. I had a sea of broken images. Even though the page had fully loaded, the images were set to "lazy" loading. When my…

What if civilisation *doesn't* collapse?

· 17 comments · 600 words · Viewed ~553 times


An eReader with a pen.

A few years ago, I got rid of all my paper books and switched exclusively to eBooks. Whenever I tell bibliophiles this, they usually shriek in horror. What about the smell of books?!!? What about showing off your bookcases to impress people!?!? What about your signed first editions!??!?! But the other day I had someone scoff at me and say "Good luck reading when civilisation collapses! I'll…

Who reads my blog?

· 144 comments · 300 words · Viewed ~564 times


Some giant question marks standing in a field. Photo by https://www.flickr.com/photos/dbrekke/181939582/

Hello! Thank you for reading what I write. Sorry to ask, but… who are you? I was chatting to a friend about what it is like running a blog, finding new topics, keeping up with a daily schedule, moderating comments, etc. And they asked, quite reasonably, "who are your readers?" And, honestly, I have very little idea! The only analytics I have on here is basic WordPress JetPack statistics. I can s…

Let's close all the ticket counters

· 19 comments · 600 words · Viewed ~825 times


Cartoon. An old woman is at a train ticket counter. The ticket machine is out of order. The ticket office is now called "Info Hub". The ticket seller says "OK, one more time: Go home and log on to our website from your computer, create an account and purchase your ticket with your credit or debit card, download the ticket to a smartphone, then come back at the allocated time... Just what part of 'easier and more convenient' don't you get?"

I bloody hate this cartoon that's doing the rounds (I think it's by the incredibly talented Len in Private Eye). Here's what I want the caption to say: OK, one more time: Get here at least 30 minutes early because the queue barely moves and you'll inevitably be stuck behind someone trying to pay for their season ticket using pre-decimal coins. The person behind the counter either won't…

Week Notes - "Someone tell me what the hell is going on here?"

· 4 comments · 350 words · Viewed ~358 times


Still of Ncuti Gatwa as Doctor Who saying "Will someone tell me what the hell is going on?"

I mentioned in my previous weeknotes that a change was coming. I've left the Civil Service. I've started my new consultancy. And now... I've got a new job! A previous regeneration saw me catapulted into the world of health tech at NHSX. Then another saw me go to data. Then over to cyber. And now… Just like an unexpected David Tennant coming back for a few episodes, I'm coming back to health a…

Using disposable phone numbers for better security

· 8 comments · 500 words · Viewed ~2,136 times


A pair of SIM cards.

Last night I received a call from my bank. They'd detected an unusual transaction and wanted to make sure that it was legitimate. Had I recently purchased £10,000 worth of crypto in the Maldives? What?!!? No! ARGH! I started to panic. All my apes money gone! No. Wait. The other thing. I knew it was a scam from the moment "James from your bank's fraud team" started his patter. You see, I have …

Automatically deleting WordPress comments using a theme

· 350 words


The Logo for WordPress.

Let's say you want to automatically delete specific sorts of comments from your WordPress blog. For example, immediately trashing any comment that has a specific phrase "Elephant Juice" in it. You can do this by going to Settings -> Discussion → Disallowed Comment Keys. Or you can add something to your theme's functions.php file. Here's the code snippet: add_action( 'comment_post', '…

Should the WordPress scheduler use datetime-local?

· 9 comments · 600 words


The Logo for WordPress.

There's a brilliant post by WordPress about how they've optimised some of the backend code to make it more efficient. So here's a suggestion for something else which can be optimised. If you want to schedule a blog post to be published later, you have to use this WordPress control: I find it mildly annoying. I don't get why part of it is a dropdown. And the number fields don't pop up my…

Can the iPhone do that yet?

· 6 comments · 1,450 words · Viewed ~478 times


Screenshot of the iPhone homescreen showing .

While farting around online, I stumbled across this 2008 Time Capsule from Stephen Fry. In it, he discusses the state of mobile phones - diving into the problems with BlackBerry's and Apple's latest offerings. BlackBerry had released the Storm and Apple's 2nd iPhone was now 3G capable. It's quite the glimpse into what we thought the future would be like. Halfway through, he says: When the…