DEV Community

Cover image for Use OpenAI and Zapier to perform blog moderation automatically - no code required
shiyuhang0 for TiDB Cloud Ecosystem

Posted on


Use OpenAI and Zapier to perform blog moderation automatically - no code required

Nowadays, there has been an increasing number of people building their own blogs. However, moderate blogs can be time-consuming and tedious.

Fortunately, Zapier integrates OpenAI 2 weeks ago. With it, you can automate the moderation process for your blog and ensure that only appropriate content is published.

Just imagine when you write your blog. Zapier and OpenAI will moderate it automatically. Then the blog will be published automatically if it passes the moderation. Otherwise, you will receive a notification email.

Let's see how I achieve this - no code required.

Set up your blog

Ignore this step if you have built your own blog site.

Don't worry if you don't have your own blog site. Here is a simple demo that you can build a blog site in several minutes.

You can deploy it with Vercel or Netlify to publish your blog site to the internet. I just build it locally for convenience.

Image description

This demo enables you to write a draft blog and then publish it. All blogs are stored in TiDB Cloud Serverless Tier, a free and MySQL-Compatible HTAP database service.

Use OpenAI and Zapier

Here is the Zap named Blog moderation I build.

Image description

  • New Row in TiDB Cloud will trigger the whole workflow once you create a new draft (a new row will be added in Serverless Tier's post table)
  • Check Moderation in OpenAI will check for hate, hate/threatening, self-harm, sexual, sexual/minors, violence, or violence/graphic content in your post.
  • Paths will perform different actions according to the result of moderation.

Click view you can see the details of the Paths:

Image description

if your post passed the moderation of OpenAI(Flagged is false), Zapier will perform Update Row in TiDB Cloud. It will update the published field in the Serverless tier's post table so that the draft will be published.

Image description

if your post doesn't pass the moderation of OpenAI(Flagged is true), Zapier will perform Send Email in Gmail. It will notify you by email with the moderation result.

Try the workflow

Now, let's try it. Click Create draft on your blog site and create two drafts.

Image description

Image description

Wait for a moment and you will find the first blog has been published, while the second blog is still a draft.

Image description

Image description

Check your email, you will find the notification.

Image description


As you can see. OpenAI and Zapier can help you be freed from the repetitive moderation work. And a Zap template is on the way to help you build such a workflow. You can also build by yourself, it isn't too difficult.

Hope the post will help you!

Top comments (1)

av25242 profile image
Arun Vijayraghavan

Great article, now every developer can Revolutionize their data analysis needs with the combined strength of TiDB and OpenAI.