I’ve been slowly migrating my notes from Obsidian to Tana, and part of that involves essentially visiting every blog post on here again (inside of my notes) to get things properly tagged. It’ll be wildly useful when I’m done, but it’s rather tedious right now.
However, I’m getting a lot of value out of seeing those old posts again. There are a handful of old posts that I reference fairly often, but most posts are published and forgotten. This process has brought them back to light, and it’s been great.
I wanted to find a system kind of like Readwise that would take all of my posts and show me a random one every time I asked. As far as I can tell that system doesn’t exist, but please correct me if I’m wrong.
Instead, I had ChatGPT write me a simple WordPress plugin that does the trick, and it’s great! You can check it out here if you’re curious; every time you refresh the page, it shows another random post from my archive.
If I’m logged into the site, I also get a button on the screen that allows me to exclude that particular post from coming up again. There are a lot of posts on the site that are worth keeping on here but aren’t as valuable for me to revisit (like “new” WordPress features from years ago, or the various “Sunday Summary” posts). I’ll see them once, and then it’ll hide them going forward. The button just looks like this:
ChatGPT to write code
The experience of having ChatGPT write this code was mind-blowing. Here are the things I asked along the way in order to get what I wanted. Not only did it do a great job, but you can see my plans evolve as it came together:
- Write code for a wordpress plugin that shows the full content of a random post each time the page is refreshed
- This is good, but I only want the random post to show on a specific page, not on the main pages.
- Excellent. Now I’d like to have it display the original post date on that page as well
- Now include a button on the page that I can press that will exclude this specific post from appearing again in future random refreshes
- When i click the “exclude this post from future”, have it load another random post once it’s done adding it to the exclusion list. Also, add a second button next to that one that simply refreshes the page to show a different random post.
- When I click the “show another random post” button, the screen just turns white
- It’s still showing a white page after I click that button (this time it solved the issue)
- (for me, out of curiosity): Where are these exclusions stored in the wordpress database?
- Only show the two buttons if a user is logged into the site
It was crazy to spend 10 minutes chatting with ChatGPT and getting a relatively complex plugin created. The refresh stuff I probably could have figured out on my own, but the “include a button on the page that I can press that will exclude this specific post from appearing again in future random refreshes” is way beyond my coding skillset these days.
This taught me a bit more about the power of ChatGPT, but it also gave me a page to visit from time to time to refresh my memories on those old posts. Win win!
Leave a Reply