Automate your blog with AI
In the era of AI advancement, I've embraced AI tools to streamline my daily tasks as a software developer. The applications of AI are vast and seem almost limitless. Even as I write this, GitHub Copilot assists me in crafting this text.
AI tools like ChatGPT and Stable Diffusion, coupled with automation tools like make.com and n8n, offer a world of possibilities to simplify our lives. Still, it's important to understand the possible negative effects of AI, like its potential to be misused for creating fake news and deceptive videos.
In this post, I'm excited to demonstrate how we can leverage tools like ChatGPT combined with automation platforms such as make.com or n8n to automate the creation of blog posts. Our primary resource for this experiment will be the transcriptions of YouTube videos.
Resources
To effectively automate our blog posts, we need reliable sources to base our posts on. In this example, I'll be utilizing automatically generated video transcripts from YouTube videos. However, I want to stress the importance of using content responsibly and only drawing from sources that grant you permission or ownership rights.
For the purpose of this illustration, I'll be working with a video by tazzan.
Remember, aside from YouTube videos, you can tap into various other resources such as RSS feeds, APIs from other social platforms, or even emails.
Toolkit
Let's explore the array of tools that I'll be relying on for this process:
ChatGPT
A household name in AI, ChatGPT will be our go-to tool for constructing the blog post. If you're fortunate enough to have access to the GPT-4 model, I recommend employing it for optimal results in generating the final blog post.
If you're inclined to explore alternatives, consider using your own self-hosted Language Models (LLMs) or similar tools in place of ChatGPT.
n8n
To orchestrate the automation, I'll be utilizing n8n in this guide. Personally, I work with my self-hosted instance, but tools like make.com or comparable alternatives can also be employed.
Ghost
For my blog infrastructure, I've opted for Ghost as the content management system. The strategies shared here should be adaptable to other blog systems that offer API interactions.
Automation workflow
Process
Let's examine the process that lies beneath this automation:
1. We execute a bash script on our system that handles the download and
refinement of the selected video's transcript. Subsequently, this script triggers
n8n's webhook, passing along the transcript within the request body.
2. Initiate a call to the n8n webhook, passing the scrubbed transcript as the
request body.
3. The n8n workflow is triggered, subsequently sending a request to the OpenAI
API to generate the actual blog post.
4. As a last step, we create a draft post via the Ghost API, which we can further edit and publish.
The following Bash script downloads and refines the transcript of the specified YouTube video before dispatching it to the n8n webhook, thus initiating the process of generating a blog post.
This script has exclusively been tested on an Arch Linux machine and necessitates the installation of the following packages: yt-dlp
You can find the download link to my n8n workflow template, which you can easily import, below:
Refining the Process
As an enhancement, you could consider integration image generation tools like Stable Diffusion or DALL-E.
Conclusion
AI-powered tools will be a big part of how we get things done in the future. When we use them thoughtfully, they can really change how we work and come up with new ideas. Just remember, it's important to use them responsibly so that we use technology in helpful ways.
Here's an example post that was made using the steps explained in this guide:
Acknowledgement
I got inspired by this video from 'Bugswriter': When ChatGPT meet Lazy Linux user