Facebook’s not a big issue: I don’t write anything there, and I’ve found it not-too-difficult to live without pictures of the baby goats of that woman I once had the crush on in the mid-1980s.
Twitter, though, is proving harder to kick. I have, after all, tweeted more than 33,000 times over the last decade, so it’s become something of a habit built in to my daily flow.
But, spurred on by the POSSE crew, I’ve come to realize that I don’t need to quit cold turkey: I can revert to the pre-2006 style of using this blog as my exclusive place to write on the web, and push as needed to other services to syndicate what I write to people who can’t, or won’t, drop by here.
Sort of like John Steinbeck in The Guardian in the 1940s.
Twitter’s ace in the hole, posting-wise, is its excellent Android client, which makes posting photos quite easy. I wanted to continue to be able to post photos, but I didn’t want to have to open a mobile browser, login to Drupal, and navigate through the process of creating a new post in that tiny environment.
So I decided to create a workflow that would allow me to post here via email.
Here’s how I did it.
I host my email with Fastmail, and Fastmail makes it very easy to set up new email aliases, so I set one up: a dedicated email address that would exist solely to receive and forward new posts for this blog.
Next, I created a new Postmark account and set up a new “Server” and then setup an Inbound webhook, allowing me to receive email at a special inbound.postmarkapp.com email address and forward it on as JSON via HTTP POST to a web service of my choice:
A new Postmark account includes 25,000 “credits,” and each inbound email processed uses a single credit, so I should be good posting-by-email until pretty close to the end of time with my available balance.
Back on Fastmail, I set the “forwarding address” for my new blogging email address to this new Postmark webhook:
And, finally, I created a PHP script to be the target of the webhook and strapped it to a secure server: the script receives JSON from Postmark, pulls it apart, finds any photos in the body and resizes them if needed and moves them into place where Drupal can find them, and finally creates a new Drupal node using the email’s subject line as the node title and the body of the email as the node body.
As a result, the flow for posting a photo here by email is as simple as this:
I sent that email and, a few seconds later, this post resulted.
A few important things to note:
- There’s no authentication involved: anyone with the email address can post here. And so I use a hard-to-guess email alias. That said, sharing the email with a trusted friend is an easy way to allow someone else to post, no fuss no muss (that’s how Olle was able to post this photo).
- I recently updated the script to look for MP3 files in the email too; if it finds one, it creates a new “sound” node. Like this one, created by email from Street Food Thursday in Berlin.
- Another recent update: the body of the email is now assumed to be Markdown, and it’s converted from Markdown to HTML before being posted to Drupal.
This workflow has proved very satisfying. It’s now as easy to post a photo (or sound, or note) here as it is to post it to Twitter. And whatever I post ends up on Twitter anyway, via an IFTTT recipe that echoes all posts to new tweets:
And to Facebook as well:
My digital emancipation continues.