/

Automating the Sharing of Old Blog Posts on Twitter

Automating the Sharing of Old Blog Posts on Twitter

Having a lot of evergreen content on your blog is great, but how do you make sure it continues to reach your audience over time? In this tutorial, I will explain how I automated the process of repurposing my old blog posts on Twitter, ensuring that they reach a wider audience and provide value to my readers.

The Problem

Every time I write a new blog post, I share it on Twitter. However, if one of my followers doesn’t see it in their feed, chances are they will never see it again. This is a disservice to both me (as the content creator) and to potential readers who might benefit from the information in the post.

While I occasionally share old posts manually, it is a tedious and time-consuming process. I have to remember to do it and keep track of which posts I have already shared to avoid repetition.

The Solution

To overcome this problem, I decided to create a simple automation tool that would automatically share two old blog posts on Twitter every day while I’m sleeping.

The Stack

To build this automation tool, I chose to use Node.js hosted on Glitch. Glitch is a great platform for building and hosting full-fledged Node.js apps, and it even wakes up the app when an HTTP request is received.

For storing the data, I opted for Airtable. Airtable is a mix between a spreadsheet and a database, making it easy to add and export data through its API.

Implementation

To implement the automation, I created a Node.js app on Glitch. The app communicates with Airtable and Twitter to fetch the old blog posts and share them on Twitter.

The app is divided into several steps:

  1. Initializing Airtable: I used the official Airtable.js library to connect to my Airtable base.
  2. Paginating the records of the table: Since Airtable returns records in chunks of 100 rows at a time, I used the eachPage method to fetch and store all the posts.
  3. Processing all the posts: Once all the posts are fetched, I filter out the ones that have already been shared recently. If there are no unshared posts, I select the first post from the list of all posts. I then check if it’s possible to tweet at that moment by setting a minimum time interval between tweets. If everything checks out, I update the last tweet timestamp, tweet the post, and mark it as shared in Airtable.
  4. Using Express as the HTTP server: I used Express to expose the functionality of the app through a URL. The app listens for GET requests on /repurpose-old-post and checks for a secret URL parameter to prevent unauthorized access.

Automating the Process

To further automate the process, I used IFTTT (If This Then That) to call the app’s URL at specific times during the day. IFTTT allows you to create applets with triggers and actions, so I set up an applet to call the app’s URL daily at a specified time.

Conclusion

By automating the sharing of old blog posts on Twitter, I can ensure that my evergreen content reaches a broader audience and continues to provide value over time. Using my own custom app built with Node.js and hosted on Glitch, I can efficiently repurpose my old posts without the need for external services.

Remember, when sharing old blog posts on Twitter, it is essential to maintain a balance between self-promotion and engaging with your audience. Use this automation tool as a way to supplement your active involvement on Twitter and foster conversations that will help grow your following.

Tags: automation, Twitter, blogging, Node.js, Glitch, Airtable