Open Thinkering

Menu

Tag: Wordpress

Exporting blog posts to JSON for easier use with LLMs such as ChatGPT

I’m currently working on the End of Module Assessment (EMA) for my MSc in Systems Thinking which involves pulling together a lot of learning over the past few months. I’ve captured a lot of it here, in this category of my blog.

What I want to do is to query a Large Language Model (LLM) such as GPT-4. However, referring to external URLs in ChatGPT is not always straightforward, and copy/pasting each post individually is tedious.

Adam Procter gave me the idea of exporting the posts to a file format called JSON, and then uploading that into GPT-4 for ease of referencing. So, given I’m not a programmer, I enlisted the help of ChatGPT to create a very small and simple WordPress plugin.

The above video shows how it works, but after activating the plugin, you can export all posts, or just those in a particular category. The downloaded JSON file can be used anywhere, with LLMs online or offline.

You can download v0.2 of the plugin here.

I’ve already found it useful to help pull in ideas that I wrote about a few months ago that I forgot might be relevant to a particular question I’m answering as part of my EMA. If it’s useful to you in its current form, then great! Just don’t bug me for updates. 😉

One does not simply move off Substack

As I’ve previously mentioned, I’ve decided to move away from Substack for my Thought Shrapnel newsletter. This is due to a fundamental disagreement with the platform’s hosting policies, particularly its accommodation of Nazi content.

In my search for a different platform, I’ve noticed that many people are migrating to Ghost. This seems particularly true for those with some technical background. Unlike Substack (an all-in-one platform for writing blog posts, sending newsletters, and posting social network-style updates) other options such as Ghost require a more hands-on approach to configure.

After looking at different options, and being advised by my network, I chose micro.blog. It looked like a simple, indieweb choice that is compatible with ActivityPub and can automatically send out a weekly digest of posts. The $10/month plan seemed ideal, and I began by importing posts from WordPress.

However, I encountered several hurdles:

  • Importing: the sheer volume of posts on Thought Shrapnel meant that the exported file was too large for the micro.blog importer, so I had to find a tool to split the WordPress file into smaller segments.
  • DNS: after adjusting the DNS settings to redirect to micro.blog, I experienced issues with email settings.
  • Email: despite moving everything to Cloudflare in an attempt to fix things, a problem arose with receiving verification codes, meaning I could no longer log in to micro.blog and complete the migration.

These challenges made me question whether individuals with less technical expertise could easily navigate such a migration? It’s not just following instructions, but troubleshooting, and indeed having the mental model of what’s going on.

Faced with these issues, I’m contemplating a return to MailPoet, an email newsletter plugin for WordPress I used before moving to Substack. However, it’s not without its quirks, such as random unsubscriptions and the need to comply with new email sender requirements from Google and Yahoo.


I feel like using platforms like Substack is akin to driving a car without needing to understand its mechanics – you just fill it up and go. Migrating to a different platform requires a deeper understanding, which is like someone interested in the ins-and-outs of car engines and maintenance.

These experiences highlight the complexity involved in migrating from an easy-to-use platform like Substack to alternatives that involve some technical input. You can’t tell people to just move off Substack. There are network effects. For some people, we’re talking about their livelihood. While there are more technical people who can fix this themselves, and better-off people who can get others to sort it out for them, what about the majority in the middle?

Personally, I’m determined not to return to Substack, but I’m still exploring the best way forward. To be honest, I just want something that works. Finding time to post to Thought Shrapnel is challenging enough, without all this additional drama.

Tinkering with WordPress category archive pages

Screenshot of MSc Systems Thinking category archive page.

Through a combination of trial-and-error, latent knowledge built up from using WordPress for over 15 years, and ChatGPT, I’ve found a way of generating more visitor-friendly archive pages for each of my blog post categories.

The reason I’m thinking about this at the moment is because I’m publishing a lot relating to my MSc in Systems Thinking in Practice, and am linking to the category archive at the top of each post.

I’ll not go into too much detail, but I wanted to replicate the style of my main archives page which is generated using the Simple Yearly Archive plugin. I duplicated archive.php in my themes folder, renamed it category.php and then tinkered around with it. ChatGPT was excellent at giving me the code I needed to do the things I wanted, including for the category RSS feed.

I then looked my Open Badges category archives page to ensure everything was working, and noticed that at some time in the past I’d added some code to change the background colour. After taking a while to figure out how I’d done that, I discovered that it’s super-easy to do by going to ‘Appearance’ then ‘Customise’ in the admin dashboard, then adding ‘Additional CSS’.

Here’s what I used to change the background colour of the MSc Systems Thinking category:

body.category-msc-systems-thinking { 
background-color:#DFEEED;
color:#333;
}
.category-msc-systems-thinking .site { 
background:#DFEEED; 
}
.category-msc-systems-thinking a { 
color:#333; 
} 

To improve this further, I’d organise the category page by tag as well as date. But that’s quite enough for this morning. I’ve got some proper work to do!

css.php