DEV Community

loading...

How To Build a Twitter Bot With Google Sheets, Parabola, and Zapier No-Code Tools

maxkatz profile image Max Katz Originally published at maxkatz.org on ・5 min read

Last year I published a video on how to create a Twitter using no-code in 10 minutes:

A few people asked me if it’s possible to create a similar bot that would post random quotes to Twitter, from a Google Sheets for example.

Video comments

I upgraded the Twitter bot to get random text from Google Sheets document and create a tweet with it. Let me show you how it works.

Tools used

I used the following tools to build the bot:

  • Google Sheets – document with two sheets. One sheet holds all the world countries. Another sheet holds the randomly selected country to be used in a tweet
  • Parabola – chooses random text from a list and saves it into a second Google Sheets sheet (tab)
  • Zapier – a zap that monitors the second Google Sheets sheet. When a new row is detected, uses the new row data to create a tweet

The question on YouTube asked me about random quotes. Instead of actual quotes I used all the world countries as random text. This helps with the quote being unique. If you have a short list of unique text, there are more chances the same text will be used twice. Twitter doesn’t allow identical tweets to be posted. If this happens Zapier zap stops working (you will need to go to Zapier and turn it on back). If you have a large and truly unique list of quotes, you can of course use the list exactly the same way.

Google Sheet to Store Quotes

Google Sheets is used to store the quotes. It stores a list of all the countries (that’s the random data) and in another sheet it stores the randomly selected country to be used in a tweet. The first sheet stores all the world countries:

World country list

The second sheets stores the randomly selected country (every selection is appended to the end):

Randomly selected countries
Randomly selected countries

Next I used Parabola for loading, selecting a country and saving the selected country.

Using Parabola for Loading and Picking a Random Country

I used Parabola to load the country list, choose a random country and save the random country into Random Country sheet (to be picked up later by Zapier).

This is how the Parabola flow looks:

Parabola flow
Parabola flow

There are three steps:

  1. Pull from Google Sheets (load the country list)
  2. Limit rows (choose a random country)
  3. Send to Google Sheets (save the random country to another sheet)

Let’s review each step in more detail.

Pull from Google Sheets

The first step in the flow is to load a Google Sheets file which has all the world countries.

Loading data from Google Sheets step
Loading data from Google Sheets step

Limit Rows

The next step, Limit rows step, has a nice feature that allows you to specify how many random rows to select. In our example you want one row.

Selecting a random country step
Selecting a random country step

The last step is to save this row into another Google Sheets sheet (tab).

Send to Google Sheets

In the last step Parabola takes the randomly selected country and sends it to another Google Sheets sheet.

Saving the random country to Google Sheets
Saving the random country to Google Sheets

That’s it for Parabola. The last step is to use Zapier to create and post the tweet.

Creating a Tweet with Zapier

A Zapier zap will check for updates in Google Sheets. If a new row has been added, it will create a tweet with that row data.

This is how the zap looks:

A Zapier zap to get new row data and create a tweet
A Zapier zap to get new row data and create a tweet

Usually each step in a zap has a number of sub-configuration steps. This is how it looks for Google Sheets:

Configuring Google Sheets in a zap
Configuring Google Sheets in a zap

The zap is connected to Google Sheets Random Country sheet. If a new row is added (by Parabola), this zap will be invoked. It will take the new row data and create a tweet with it. That’s the second step in the zap. And that’s it. The zap is on and usually runs instantly (the actual execution could be delayed for a few minutes).

Testing

On the Parabola side you can schedule the flow to run periodically. You can run it as often as every 5 minutes.

Scheduling a Parabola flow
Scheduling a Parabola flow

You can also test the Parabola flow by clicking the Test Flow Now button.

Testing Parabola flow
Testing Parabola flow

The resulting tweet will look like this:

Posted tweet
Posted tweet

Summary

This blog post showed show how to create a Twitter bot powered random data. You can use any random data you like. Just keep in mind that Zapier will turn off the zap if a duplicate tweet is created (you would need to go and turn it back on). It’s not a complicated examples but shows the power of no-code. It shows how you can leverage three different no-code tools (Google Sheets, Parabola, and Zapier) to build a small working application (bot). I’m always happy to hear you feedback. If you have any other bot or no-code ideas, please let me know!

Discussion (0)

pic
Editor guide