Skip to main content

How to automatically create Tweets from website content with ChatGPT & n8n

Learn how to create content for Twitter (X) with AI

Updated yesterday

You can automatically turn new website content into tweets using RSS.app, ChatGPT, and n8n. This workflow collects new posts from your chosen website, has ChatGPT craft tweet text, and then publishes those tweets automatically on your Twitter (X) account.

Prerequisites

Step 1: Generate RSS feeds with RSS.app

1. Go to RSS Generator.

2. Paste the URL of the content you want to turn into a feed (e.g. a Twitter profile, subreddit, or blog).

3. Click Generate.

4. Once your feed is ready, click Save to My Feeds.

5. Copy the generated XML URL.

You can apply filters, adjust Feed Output settings, or create multiple feeds and combine them into a single stream using our Bundles feature.

Step 2: Set up OpenAI API access

2. Open the API Keys page and click Create new secret key.

3. If you’re using the API for the first time, add a small credit balance in the Billing section to activate token usage.

4. Copy your secret key.

Step 3: Generate Twitter (X) API keys

1. Open the X Develop portal and login with your X account credentials.

2. Click on Developer Portal and open the App Settings.

3. Scroll down until you see User Authentication Settings. Click Edit.

4. Select the following options:

5. In the App Permissions section, select Read, Write, and Direct Messages.

6. In the Type of App section, select Web App and Automated App or Bot.

7. In the App Info section, enter the following details:

  • Callback URI/Redirect URL:
    https://oauth.n8n.cloud/oauth2/callback

  • Website URL:
    https://n8n.io

8. Click Save, then confirm by selecting Yes.

Copy the Client ID and Client Secret values and store them in a safe place. You’ll need them to connect your Twitter (X) account to n8n.

Step 3: Add an RSS Feed Trigger in n8n


1. Click Create Workflow in your n8n dashboard.

2. Click the + button and search for RSS Feed Trigger.

3. Choose how often you want n8n to check your feed for updates by setting the Poll Time.

4. Paste the RSS.app feed URL and click Fetch Test Event.

n8n will fetch the latest feed items according to your poll time.

Step 4: Add a Google Sheets Action Node

1. Click the + button and search for Google Sheets.

2. Choose the Append or update row in sheet option.

3. Click on Credential to connect with and connect your Google account.

4. Select the document and sheet where you'd like to upload the RSS feed data.

5. Map the fields from the RSS feed to the columns:

6. Click Test Step to verify that everything works as expected. The fields you mapped should automatically appear in your Google Sheet.

Step 5: Add a ChatGPT node for analysis

1. Add an OpenAI node to the workflow.

2. Open the Credentials window and paste your OpenAI API key.

3. In the Operation field, select Message a model.

4. Choose your preferred model.

5. In the Prompt field, paste your custom instruction depending on the kind of Tweet you want to craft.

6. Map the fields from the previous node (for example, Title, Description, Link) so ChatGPT has all the context it needs.

7. Click Execute Step to confirm it’s working.

Step 6: Add a Google Sheets node for AI results

1. Add another Google Sheets node.

2. Connect it to the same spreadsheet but use a second sheet, such as Tweets.

3. Map the fields you want to include from the RSS feed or ChatGPT results.

4. Click Execute Step to test. The AI-generated Tweet should appear in your sheet.

Step 7: Add a Twitter node to post tweets automatically

1. Add a Twitter (X) node.

2. In the Operation field, select Post Tweet.

3. Open the Credentials window and paste your Client ID and Client Secret from the Twitter Developer Portal.

4. Click Connect to authorize your account.

5. In the Tweet Text field, map the ChatGPT output.

6. Click Execute Step to test. A new tweet should appear on your Twitter profile.

Step 7: Run and activate the workflow

1. Click Execute Workflow to run everything together.

2. Toggle the Active button to turn on the workflow.

3. Check the Executions tab anytime to see your workflow history.

With this setup, every time a website publishes new content, RSS.app instantly captures it, n8n logs it in Google Sheets, ChatGPT generates a tailored summary, and a tweet is automatically posted.

Did this answer your question?