Skip to content

How to Automatically Share Top News Headlines on Facebook using OpenAI

  • by

Let us explore how you can integrate OpenAI with Facebook and automatically share the top news headlines of the day on Facebook using OpenAI.
This automation requires a one-time setup, for which we will use Pabbly Connect.
We will first add a Schedule trigger to the workflow to set a specific time for posting the news, then link Pabbly Connect with OpenAI to capture the latest news, and lastly, share the news on Facebook.

Steps to Automatically Share Top News Headlines on Facebook using OpenAI

1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Add Schedule as the Trigger App to Set Time to Post News
3. Add Date / Time Formatter to capture the Current Date
4. Setup OpenAI as the Action App to Generate Latest News
5. Setup Facebook Pages as the Action App to Post News

Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow

A. Sign In / Sign Up

To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.

Click on the Pabbly Connect ‘Access Now’ button

B. Create Workflow

To create a new workflow, click the ‘Create Workflow’ button.

Name your workflow, and click on ‘Create’.

Step 2:- Add Schedule as the Trigger App to Set Time to Post News

Trigger is the app that executes the workflow. Since we want to post news and execute the workflow at a specific time, in our case it would be Schedule by Pabbly.

Choose ‘Schedule by Pabbly’ as the Trigger App, select how often you want to send the message, set a Date and time to execute the workflow, and click on ‘Save’.
Note: Make sure to check your Time Zone.

Step 3:- Add Date / Time Formatter to capture the Current Date

Let us now add a Date / Time Formatter to our workflow to fetch the current date and feed it to OpenAI to generate the latest news.

Choose ‘Date/Time Formatter by Pabbly’ as the Action App, select ‘Current Date’ as an Action App, and click on ‘Connect’.

Select a Basic Format, choose whether you want to Include Time in Response, and click on ‘Save & Send Test Request’.

Step 4:- Setup OpenAI as the Action App to Generate Latest News

Action allows us to choose the application that will get executed by the workflow trigger.
Since we want to generate the latest news of the day using OpenAI – it will be our Action App.

Add another Action step to your workflow by clicking the ‘+’ button.

A. Action App

Choose ‘OpenAI’ as the Action App, select ‘Generate Content’ as an Action Event, and click on ‘Connect’.

B. Connect OpenAI Account

To connect with your OpenAI account, select ‘Add New Connection’. You will be prompted to enter your API Token. Find your API Token by clicking on the ‘OpenAI API Keys page’ button.

Generate and copy your API Token, paste it into its given field, and click on ‘Save & Send Test Request’.

Select the AI Model you want to use for generating the article.

C. Enter / Map the Necessary Fields

Now that you have connected your OpenAI account, all you need is to map the necessary details from the step above. Mapping ensures our data remains dynamic and changes as per the received responses.

Compose a Prompt by mapping the details from the step above.

Similarly, select/enter other fields, leaving the unnecessary ones empty, and click on ‘Save & Send Test Request’.

As soon as you click on Save & Send Test Request, the latest news will automatically be captured using OpenAI.

Step 5:- Setup Facebook Pages as the Action App to Post News

Action allows us to choose the application that will get executed by the workflow trigger.
We essentially want to post the captured news on Facebook. Thus, Facebook Pages will be our Action App.

A. Action App

Choose ‘Facebook Pages’ as your Action App, select ‘Create Page Post’ as an Action Event, and click on ‘Connect’.

B. Connect Facebook Account

To connect with your Facebook account, select ‘Add New Connection’ and click on ‘Connect With Facebook Pages’. Also, grant the authorization.

Select the Page on which you want to post the data.

C. Map the Message

Map the Message to be posted from the step above, and click on ‘Save & Send Test Request’.

The moment you click on Save & Send Test Request, the latest news will be posted to your Facebook Page.

Our automation is complete. We have successfully integrated OpenAI with Facebook. Now, each day the latest news headlines will automatically be generated in OpenAI and posted on Facebook.

You can copy this entire workflow by clicking this link.

Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum