Tom Pearson

March 20, 2021

feed reader 2021

Morning! Evening!
The last couple of posts I’ve made have been composed in and sent from my email account before being transformed into a blog-post on my website via a couple of free technologies (my motivation for doing this, 1. save the content 2. make it easier for me to update that blog). It’s the kind of process which would have been a complete pain back when I started making things for the web but which takes only a short time to set up these days with (mostly) free technologies.

The key bit is not free though, its  a hey.com email address. Hey let their customers send an email to a special address and then it publishes it to a simple web page it also behaves like a newsletter (perhaps particularly relevant at the moment when writers are looking for a substack alternative).

At a high level the publishing process looks like this:
1. Write and send HEY world email. 2. Grab published feed and save posts as markdown. 3. Push those posts to my jekyll blog on github so they can be seen by the internet.

In more detail:

1

you know how to send an email right?

2

Once my email has been sent and published I wrote a script to
  • grab the atom feed
  • parse the xml into a javascript object
  • for each feed entry decode the content section
  • convert that content from html to markdown
  • save the entry as a markdown file with some standard jekyll front matter 

Most of the above is achieved by stringing together modules from the  npm ecosystem and very little thinking was required on my part beyond choosing the least flaky looking option for each step. 

3

The thing that joins the dots between the email, the script and the final blog post is a GitHub action. A Github action is a process running on an on-demand server owned by github which is triggered by an event of some kind. In this case i’ve set it up so that every hour the feed-getting script runs, and pushes its output to my blog. Github actions are great, a kind of flexible-enough light weight solution that can plug all sorts of workflow holes that used to require the running and maintenance of a server.

I stopped paying for github about year back when, finding myself without a job at the start of the pandemic, I decided to cut back on things like that.  If they were to start charging for the use of actions i would go back to being a paid customer in a snap.

Talking about being a paid customer; I really like using hey.com for emails, the main attraction is that it requires you to opt in to receive any emails from any address. Once you choose to receive emails you can then choose whether they go to your main inbox, ‘paper trail’ where you can put confirmation emails etc. and ’feed’ where newsletters and so on go. Its a remarkably simple idea well executed, it makes me want to use email more.

Anyway, i’m now going to press send and see if the process described above works...