
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 webpage is trivial to edit. But data should be provably true. Recently, a prominent person's…
Continue reading →
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 substitute them with your own keys. from rauth.service import OAuth1Service, OAuth1Session # Get a…
Continue reading →
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 itemtype="http://schema.org/ScholarlyArticle"> <span itemprop="author" itemscope itemtype="http://schema.org/Person"> …
Continue reading →
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: wZaRN7rpjn3FoNyF5IFuxg9uMzYJcvOoQ8QWiIqS3hfk6gLhVlG57j5YNoZL2Rtc This secret may change in the future. In the examples, I'll shorten it to…
Continue reading →
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: https%3A%2F%2Ftwitter.com%2FJennyVass%2Fstatus%2F1067855777040338944 Add it to the end of this URL: https://s0.wordpress.com/mshots/v1/ Add ?w=800 to the end: …
Continue reading →
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 can extract your data in CSV or JSON. I feel like I ought to be able to GDPR that and get it for…
Continue reading →
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. Create it on https://BotsIn.Space/ - a Mastodon instance specifically for robots. Set it up just…
Continue reading →
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. But here's how to get it programmatically. API The API to call is: …
Continue reading →
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 thing. No state is maintained, no multiple commands to get right, no complexity. This gets information…
Continue reading →
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..." The code I've written uses Oxford City Council's civic data APIs - which will deal with bank holidays…
Continue reading →
Update! The source-code for this app can be found at https://github.com/edent/TweeView Many years ago, I created a threaded conversation viewer for fledgling social network App.net. It was a unique way to flow through a conversation without having to be constrained by the linear vertical scroll of the typical web browser. App.net died - and I never found a reasonable way to recreate it for Twitter. Until today. Paul Butler has created "Treeverse" a Chrome Extension which lets you…
Continue reading →
This is a curated list of APIs which do not require usernames, passwords, access tokens, signing, accept-headers, or anything more complicated than sticking a URL in a browser. (This is an update to my post from two years ago.) When I introduce people to the concept of using RESTful APIs, they immediately get how powerful it is to retrieve information from the Internet and then manipulate it in software. I used to give Twitter and Flickr as examples - they're both fairly well known and have…
Continue reading →