Pocket API, more stupid Twitter bots, and hacker chic

30 April 2017

I've done a little more coding over the last few months, particularly April, but I haven't really blogged about it. So, just in case you were excitedly waiting to hear about my latest projects, here's a bit of a rundown.

Twitter bots

Over Christmas/New Year I made two new Twitter bots.1 The first one is pretty dumb and really was a way for me to play around with some automated imaging tools. Rijks Teen Press uses a program called GraphicsMagick (via the nodejs package gm) to layer a Teen Vogue headline over the top of a 'relevant' Rijksmuseum image using the Rijksmuseum API and the Teen Vogue RSS feed. Basically, it pulls a random article title from the Teen Vogue RSS feed, then chooses a random word from that title to use in an API call to the Rijksmuseum. Once it has an image and a title to work with, they're combined into a "book cover" which is then tweeted. Like I said, it's pretty dumb, but it was really fun to make and occassionally comes up with funny titles. The hardest thing about making this bot was actually installing GraphicsMagick on Linux, and getting it to run inside a Docker container.

The second bot has been somewhat more successful. Recipe_Trove takes a query via a tweet at it, and tries to return a recipe from the National Library of Australia's Trove newspaper archive. People have had great fun trying to find weird recipes via Recipe_Trove, and a side-effect is that it highlights how dodgy a lot of the OCR text is in Trove, and provides a link to go straight in and fix it.


Recently I made some updates to AusGLAMBlogs that improve things administratively but also add a cool new feature. The first thing was to add the ability for administrators (currently basically just me) to edit a listing. I've always been able to do this by editing the database directly, but that's complicated and slightly dangerous. It is now possible to change a listing at any point. This means that when people ask for their Twitter handle or blog URL to be updated in AusGLAMBlogs I can easily do it via the web interface without breaking anything in the database.

The second change was also, to be honest, designed to make my life easier, but hopefully it's useful for other people too. AusGLAMBlogs now has Pocket integration. What this means is that if you register your Pocket account with AusGLAMBlogs (super easy!), every time there is a new post from one of the listed blogs it will appear in your Pocket app. Neat! I had a few issues with getting this right - initially I was using a JSON payload to make the API call but bizarrely it worked for Pocket's web interface but nothing appeared in the iOS app. With some assistance from Justin at Pocket Support (thanks Justin) I got it working properly, and now I won't miss a post.


My latest coding project is something you've probably noticed by now, unless you're reading this in Pocket's 'article view'. I've moved my blog off Ghost(Pro) and am now self-hosting on Digital Ocean. I've been getting Ghost(Pro) at the super-cheap early adopter rate, but self-hosting gives me greater control (URL redirects now work properly) and I no longer have to route people through CloudFlare.

As part of the move I also took the opportunity to update my theme to a new one I've (not particularly seriously) called hacker_chic. I've used flex-box a bit more creatively than in the past, and headers use clip-path which is nice. Let me know what you think!

Anyhoo, that's the coding update, stay tuned for more thoughts on libraries soon.


I accidentally switched them off at the end of March, but they're back in action now.