Building A Twitter Growth Bot in 30 minutes

In this post I build a Twitter growth bot using Node and Google Cloud Functions. This was originally a live twitter thread.


The children are finally asleep. I have an idea for a Twitter growth tool. Follow along here as I #buildinpublic Man with comedy glasses hacking at a computer

💡 Idea
A bot that automatically tweets once a week as me and tags the 5 accounts with the most replies to my tweets in the last week.

All you have to do to be tagged is to reply to my tweets.

We’ll use Google Cloud Scheduler and Cloud Functions
It took me a while to find a quickstart for cloud functions and typescript 👇🏻
github.com/GoogleCloudPla…

Google Cloud Platform Node Framework functions-framework

Hello World 👍 Web browser with a blank webpage showing Hello, World

I don’t have access to Twitter API v2 yet. But I have an old V1 app so let’s use that for this experiment.

I’m using this twitter API client
NPM logo

twitter-api-client

Let’s get the last 10 replies to my tweets. Code snippet to get last X replies to a Tweet

So we can get the last X replies.
Now to:
- Make sure they aren’t over a 7 days old
- Collect all the users and count them browser window showing a JSON array of tweets

Well, that seemed to work well. A tweet saying 'My top five Twitter users this week are...'

Now we use Cloud Scheduler to run our function every Friday. A Google Cloud Scheduler configuration form

• • •

That’s the end of the Twitter thread. It was great fun to build this tool and I’m getting great engagement from it each week. If you want more like this, follow me on Twitter.

Original Twitter Thread