How To Automatically Turn Blogs And Articles Into Videos Using AI

23 August 2023 | 10 min read
Laura van Sinderen

In this tutorial, we'll use AI to summarize a web page, then convert it to a video using Zapier. This is great for turning articles, blogs, and product pages into social media videos.

Whether you have an e-commerce store, a blog, or a website that regularly publishes articles, video is one of the most effective means of promoting your content on social media.

Having said that, do you really want to make a video every time you publish new content on your site? Most likely not, given the extra labor involved. Fortunately, modern automation tools enable this task to be completely automated, and I will demonstrate this process in this tutorial.

This guide will show you how to summarize and convert any kind of web page into a short video, and then share it on social media – fully automated. As an example, we will be using an article from our own website, titled "The Best Video Generation APIs". We will use AI (GPT-3 or GPT-4) to summarize the article in two short sentences, then create a video from the AI-generated text, and finally post the video on Twitter. Here's how the video turned out:

The video was fully auto-generated by AI based on one of our own blog articles.

For simplicity's sake, we will keep the final video nice and simple. However, if you have a completely different idea, you can make your own automated video template using the online editor. And as we're using Zapier, you can customize the workflow exactly to your needs. This makes this approach incredibly flexible for creating video content automatically using AI.

Let's dive in!

Prerequisites

These are the tools we'll use:

  • Creatomate: to create a template and generate videos. Sign up for free.
  • Zapier: to set up the automated workflow.
  • Airtable: or any other app to provide the content URL and an image.
  • OpenAI: to summarize the content.
  • Twitter: or any other social media platform to share the video with your followers.

This tutorial won't focus on Airtable or Twitter, so feel free to replace them as you like.

How to convert blogs and articles into social media videos using AI and Zapier?

To get started, we'll create a video template in Creatomate, which will be used as the design for all our videos. Next, we'll set up a Zapier workflow that triggers when new records, containing a content URL and an image, are added to Airtable. After that, we'll extract the content from the blog post and create a shorter version suitable for processing by OpenAI. Using GPT-3, we'll generate a concise two-sentence summary that captures the essence of the content. This summary will be formatted appropriately for Creatomate to generate a video. Finally, we'll be able to share the resulting video on Twitter. Here's what the Zap looks like:

Let's get started by creating a video template.

1. Create a video template in Creatomate

Log in to your Creatomate account and navigate to the Templates page. Click the + New button to browse the template gallery. You can pick any template you like or design your own from scratch. But for this tutorial, let's use the Content Promotion template from the Announcement category. Choose a size you want, like 16:9 Landscape, and click Create Template to open it in the editor:

A template consists of several elements, all visible in the left side panel. Certain elements are marked as dynamic, enabling their content to be replaced with other text and media through the automated Zapier workflow. In our particular template, the Title, Text-1, Text-2, and Background elements are dynamic.

Feel free to customize the template to suit your needs. You can, for instance, replace the placeholder logo with your own. If you wish to make any element dynamic, you can do this by selecting the element and enabling the Dynamic property from the right side panel, as demonstrated above.

To keep things simple, I'll use the template as it is. Now, let's proceed to set up the Zap.

2. Add trigger: New Record in Airtable

Want to use something other than Airtable? Replace this trigger with any other Zapier app of your choice.

First, we'll create an Airtable document. Let's set up a table with two fields: a URL field for Content URL and an attachment field for Image. Once that's done, we can input some sample data into the first record:

Log in to your Zapier account and click the + Create Zap button. Search for and select Airtable as the trigger app and New Record as the trigger event. Continue by selecting your account or signing in first.

On the Trigger page, select your Base and Table. Then, click Continue:

Click Test trigger on the Test page to make sure Zapier can find the record we've just created. When the test is successful, click Continue with selected record, and move on to the next step.

3. Add action: Parse Webpage in Web Parser by Zapier

This action lets us parse the blog post and retrieve its content, so that we can summarize it with GPT-3 in the following steps.

Search for and select Web Parser by Zapier as your action app and Parse Webpage as your action event, then click Continue.

On the Action page, select Airtable -> Content URL in the URL to Parse field. Choose HTML for the Content output format and select False for the Continue on failure option. Then, click Continue:

Click Test step on the Test page. The test result should display the content from the page in the content field as HTML.

4. Add action: Text in Formatter by Zapier

At the moment, GPT-3 only allows you to send a limited amount of data to summarize, so we'll need to truncate the article to make sure we don't exceed this limit.

Click +, search for and select Formatter by Zapier as your action app and Text as your action event. Then, click Continue.

On the Action page, select Truncate in the Transform field first. Then, select Web Parser by Zapier -> Content in the Input field, set Max Length to 4097 tokens, and set Append Ellipsis to True. When done, click Continue:

Click Test step on the Test page to make sure it works properly.

5. Add action: Send Prompt in OpenAI (GPT-3, DALL-E, Whisper)

In this step, we'll create a prompt to send the content of the article to GPT-3.

Click +, search for and select OpenAI (GPT-3, DALL-E, Whisper) as your action app, and Send Prompt as your action event. Continue by selecting your account or signing in first.

On the Action page, select text-davinci-003 as a Model. Then, copy and paste the following into the Prompt field:

Make a two-sentence summary of this article. Place the sentences on separate lines like "S1: first summarized sentence" and "S2: second summarized sentence".

"""

[Output from Formatter Step]

"""

Make sure to replace [Output from Formatter Step] with the Formatter by Zapier -> Output value. Check out the screenshot below to see what it should look like. Once this is done, there is no need to modify any of the other settings, and you can proceed by clicking Continue.

Click Test step on the Test page to send the prompt to OpenAI. The response should provide a 2-sentence summary, similar to the image below:

6. Add action: Run Javascript in Code by Zapier

In this step, we'll convert the output of GPT-3 into a format that Creatomate can use. Don't worry; it's simpler than it sounds. All you need to do is copy and paste a few lines of JavaScript code.

Click +, search for and select Code by Zapier as your action app, and Run Javascript as your action event. Then, click Continue.

On the Action page, type response in the Input Data field and select OpenAI -> Response. Then, in the Code field, copy and paste the following:

1const [S1, S2] = inputData.response.split(/\r?\n/);
2if (!S1?.startsWith('S1: ') || !S2?.startsWith('S2: ')) {
3  throw new Error('Unexpected response from GPT-3');
4}
5
6output = {
7  S1: S1.slice(4),
8  S2: S2.slice(4),
9};

When done, click Continue:

On the Test page, click Test step to receive the output as shown in the screenshot below. The output of GPT-3 should now be separated into two different values: S1 and S2.

7. Add action: Create Single Render in Creatomate

In this step, we'll combine data from the previous steps to generate the video.

Click +, search for and select Creatomate as your action app, and Create Single Render as your action event. Continue by selecting your account or signing in with your project's API key first.

On the Action page, select your Content Promotion template in the Template field first:

Then, the dynamic elements of the template will be automatically detected and listed under Modifications. Let's map the data from the previous steps to the template as follows:

  • Set Background to Airtable -> Image Url
  • Set Title to Web Parser by Zapier -> Title
  • Set Text-1 to Code by Zapier -> S1
  • Set Text-2 to Code by Zapier -> S2

When done, click Continue:

Click Test step on the Test page to confirm that Creatomate can successfully generate a video based on the template and provided data. You can view the video by visiting the URL given in the test result. Please note that rendering may take some time, so if you encounter a 'Not Found' message, wait a few seconds and refresh the page. This will only occur during Zap setup; once it's live, it will wait for the video to finish before proceeding with the next step.

8. Add action: Create Tweet in Twitter

In this final step, we'll create a Twitter post with the generated video so it's automatically posted to social media. Don't want that? Feel free to replace this app with something else.

Click +, search for and select Twitter as your action app, and Create Tweet as your action event. Continue by selecting your account or signing in first.

On the Action page, add a call to action and select Airtable -> Content URL in the Message field. Then, in the Image, Video or GIF field, select Creatomate -> Url. When done, click Continue:

On the Test page, click Test step to ensure it works as expected. Please keep in mind that the video will be posted immediately, so if you're just testing it out, you might want to delete it afterwards.

Last but not least, click Publish to activate your Zap.

Wrapping up

Well done! You've successfully created a Zapier workflow that automatically creates a video from a URL and publishes it to social media. Now, whenever you post new content on your site, simply add its URL and an image to Airtable, and everything else will take care of itself.

In this tutorial, we've used AI to generate a summary of the content, but you don't have to. As an alternative, you can also provide the summerized sentences yourself for greater control over the generated video. To do so, just create additional columns in Airtable for the summary, and skip the Web Parser, Formatter, OpenAI, and Code by Zapier steps.

Start automating today

Start with a full-featured trial with 50 credits, no credit card required.
Get started for free