Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Everything you know about Twitter character counting is wrong

· 800 words · Viewed ~404 times


Japanese text pasted into the Twitter compose window. It is showing that there are too many characters.

How many characters can a Tweet contain? It used to be 140, back in the good old days. Now it's 280. Unless you're Japanese. Let me explain… I run OpenBenches - a site which collects memorial benches. When a user adds a bench, the inscription is automatically Tweeted. If the inscription is longer than 280 characters, it is truncated. The PHP code to truncate text to a specific length is p…

Turn an old eReader into an Information Screen (Nook STR)

· 16 comments · 850 words · Viewed ~14,954 times


Nook with a train display.

Here's a quick tutorial for turning an old Nook into a passive display. This is an update to my 2013 post End Result An eInk screen which displays the trains I can catch from my local station. It shows the next few available trains, and whether they're delayed. It also shows how long until the next local bus to the train station. Updating the Nook Before doing anything, manually update the …

Why API responses should be signed

· 35 comments · 1,250 words · Viewed ~5,573 times


Doctor Who holding a glowing key

I'm going to start this discussion with the why and then move on to the how. Let's begin with a couple of user stories. As the recipient of some data, I want to verify that it hasn't been tampered with. and As the recipient of some data, I want to verify who originally published it. Here's why I think this is important. We are in an era of fake news. A screenshot can be easily altered. A…

Add review to Goodreads from Schema markup

· 600 words


The Goodreads Logo.

I write book reviews on my blog. I also want to syndicate them to Goodreads. Sadly, Goodreads doesn't natively read the Schema.org markup I so carefully craft. So here's the scrap of code I use to syndicate my reviews. Goodreads API Keys Get your Keys from https://www.goodreads.com/api/keys You will also need to get OAuth tokens For this documentation, I'll use the example keys - please…

Convert DOI to a HTML5 / Schema citation

· 650 words · Viewed ~220 times


The DOI logo.

This is a quick and dirty way to turn a DOI (Digital Object Identifiers for academic papers) into an HTML & Microdata citation. I use this to power my Citations page. Schema.org is a Microdata standard which allows machines to read your HTML and create semantic relations between documents. Here's a minimum viable citation: <blockquote itemprop="citation" itemscope…

Tado API Guide - updated for 2019

· 63 comments · 1,400 words · Viewed ~34,644 times


Debug screen of a web browser.

Tado is a brilliant smart thermostat. But their API is very poorly documented. This is an updated guide for 2019. I am indebted to Stephen C Phillips' original documentation. Getting started You will need: A Tado (duh!) Your Username (usually your email address) Your Password A Client Secret Getting the client secret I'm using this client secret:…

Using the WordPress mShots Screenshot API

· 7 comments · 300 words · Viewed ~4,100 times


The Logo for WordPress.

A few years ago, I wrote about Google's secret screenshot API - a slightly cumbersome way to take website screenshots for free. There's another service which you may find simpler to use - mShots from WordPress. Here's how it works: Take any website link: https://twitter.com/JennyVass/status/1067855777040338944 URL Encode it: …

Extracting your data from Untappd

· 7 comments · 1,000 words · Viewed ~3,618 times


I rate every pint I taste using the Untappd app. Think of it like TripAdvisor for lager, stout, cider, bitter, and all manner of other beery goodness. Seriously, I've reviewed over 600 different drinks Recently, I decided to see if I could self-host my beer check-ins. The first step - extracting my own data from Untappd. Pay To Play If you become an Untappd Supporter for US$5 per month, you…

Easy guide to building Mastodon bots

· 22 comments · 650 words · Viewed ~8,718 times


API keys.

Twitter is dead! Long live Mastodon! I've written lots of 'bots for Twitter - and been part of their developer outreach programme. Lots of us have politely requested improvements to the bot experience on Twitter, but to no avail. So, today I'm going to show you how to quickly and easily write your first Mastodon-bot. Bots In Spaaaaaaace Step 1 - you need to set up a new account for your bot. …

Renault's Secret Mileage API

· 1 comment · 550 words · Viewed ~781 times


Website showing my car and its mileage

Last year I reverse engineered Renault's Electric Car API. One of the curious omissions was mileage - it just doesn't appear there. However! All is not lost. If you log in to your Renault Account - https://www.renault.co.uk/my-account/my-car.html - you'll get details back about your car including its make, model, date of next service, and mileage! Why isn't this in the regular API? Who knows. …

Solar Battery and Alexa - in 30 lines of code

· 450 words · Viewed ~253 times


A list of phrases used to activate the device

Amazon Alexa is a fun little bit of kit. But it can be tricky getting it to work with all your smart devices. Not every company has an Alexa skill - just like not every company has an app. Using Flask-Ask it is possible to bring Alexa smarts to a range of previously mute devices. Alexa coding works on "intents" - the following is a simple intent. That is, you can only ask the skill one…

Alexa - what bin day is it?

· 5 comments · 750 words · Viewed ~1,345 times


A row of recycling bins.

Bin day is the most magical time of the week! Children of all ages cry "Which bins is it?! Oh! Which bins?" Is today recycling day? Or green waste day? Or humble landfill day? Should my food caddy go out? Gosh! Who can keep track? I mean, obviously I could look at my calendar. Or sign up for free SMS alert. Or use push notifications in their app. But where's the fun in that? "Alexa..." …