Relaunching @edent_solar. Part 3 - API & Code

by @edent | # # # #
Solar Graph.

I'm hooking my solar panels up to Twitter! Installation Inverter Fronius provide a comprehensive API guide - I wish more companies did this. There are lots of unofficial libraries in a variety of different languages. I've written this code in Python3. This is a general tidy-up of the code I wrote several years ago. Here's…

Continue reading →

Add review to Goodreads from Schema markup

by @edent | # # # # # #
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…

Continue reading →

Convert DOI to a HTML5 / Schema citation

by @edent | # # # # #
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…

Continue reading →

The Great(er) Bear - using Wikidata to generate better artwork

by @edent | # # # # # # | 12 comments | Read ~6,563 times.
A close up of the map.

One of my favourite works of art is The Great Bear by Simon Patterson. At first glance, it appears to be a normal London Tube map. But look closer... Cool! But there is something about it which has always bothered me. Each Tube line represents a theme - therefore, a station at the intersection of…

Continue reading →

Alexa Skills - get custom slot names using Flask-Ask

by @edent | # # # # # | 1 comment | Read ~290 times.
Alexa Skills Page.

Amazon encourages developers to use Flask-Ask - the handy Python library for working with Alexa. Sadly, the project has been abandoned. They no longer take pull requests, you can't raise bugs against it, and the documentation is incomplete. So this is how I solved an annoying problem - how to get the name of a…

Continue reading →

Extracting your data from Untappd

by @edent | # # # # # # | 4 comments | Read ~1,740 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…

Continue reading →

Convert WebVTT to a Transcript using Python

by @edent | # # # # # | 1 comment | Read ~1,193 times.
YouTube showing subtitles.

I want to convert YouTube's auto-generated subtitles into a plain transcript. Why is this so hard? This blog post gives a more detailed explanation than my answer to this StackOverflow question. Here's what the subtitles look like when you view a video: And here's what the code which generates those subtitles looks like: 00:00:00.930 -->…

Continue reading →

How to detect 3D video?

by @edent | # # # # | Read ~184 times.
Still from the moview Finding Nemo. The image is split side by side.

Here's an interesting conundrum. My TV can automatically detect when 3D video is being played and offers to switch into 3D mode - but how does the detection work? This post will give you a few strategies for detecting 3D images using Python. Firstly, some terminology. 3D videos are usually saved either as Side-By-Side images,…

Continue reading →

Reconstructing 3D Models from The Last Jedi

by @edent | # # # # # | 3 comments | Read ~3,552 times.
Different depth maps of various accuracy

A quick tutorial in how to recover 3D information from your favourite 3D movies. In this example, we'll be using Star Wars - The Last Jedi. tl;dr? Here's the end result (this video is silent): Grab the code on GitHub. Let's go! Take a screenshot of your favourite scene. Something with a clearly defined foreground…

Continue reading →

Adjusting timestamps on images with Python

by @edent | # # # # # | Read ~1,644 times.
A cute penguin.

As ever, mostly notes to myself. I have a bunch of old images which don't have any timestamp associated with them. This quick Python script will add a DateTime EXIF metadata tag to an image. This uses piexif which can be installed using pip install piexif This simple script reads a photo, adds a timestamp,…

Continue reading →