Since I reactivated my decade old twitter account, every time I tweet a post containing the word ‘Python’, iPythonistaBot would retweet that tweet. It was a fascinating experience since I wouldn’t have known it was a bot if the profile hadn’t mentioned it. Being a curious creature, I followed the original account (human who created the bot) and realized that most of his followers are people whose tweets got retweeted by his bot. On a deeper dive I became aware that its a very common practice for brands to use twitter bots to drive engagement. Twitter bots account for an estimated 15% of Twitter users. If you have not come across any till now, you should read about 10 Twitter bots that actually make the internet a better place and then come back here to learn how you can make your own.

In this post I will share 4 key points:

  1. What is a Twitter Bot?
  2. How to Create a Twitter Bot in Python via Tweepy?
  3. How to Ensure that Twitter Bots Runs 24×7?
  4. How to use the Twitter Bot for Personal Brand engagement?

A simple google search for ‘twitter bot’ led me to countless blogs explaining what a twitter bot is and how I can create one for my personal brand. So instead of writing an original post, I am going to curate the original sources, what they did right and their limitations which forced me to find a better source

What is a Twitter Bot?

A Twitter Bot is a software program that is specifically created for use on the popular social media platform Twitter. With a Twitter Bot, you automate your social media activity, such as retweeting or liking content, so that you can encourage engagement. This helps you save time and money since you won’t have to manually generate posts. You can also use a Twitter Bot as a chatbot to answer questions from customers and to support customer service. You can even use it to promote your products and services, including sharing details of new services. You should read the complete article here before continuing.

The above mentioned blog gives a brief of twitter bots and mentions the role of Python in creating a twitter bot but doesn’t teach how to create one.

How to Create a Twitter Bot in Python via Tweepy?

Twitter is one of the most widely used social networks. For many organizations and people, having a great Twitter presence is a key factor to keeping their audience engaged.

Part of having a great Twitter presence involves keeping your account active with new tweets and retweets, following interesting accounts, and quickly replying to your followers’ messages. You can do all this work manually, but that can take a lot of time. Instead, you can rely on a Twitter Bot, a program that automates all or part of your Twitter activity.

In this article, you’ll learn how to make your own Twitter Bot in Python with Tweepy, a package that provides a very convenient way to use the Twitter API. No! Not this article that you are reading but the article here. You should bookmark this article if you plan to create your own twitter bot

The above article provides step by step details of Tweepy python library provided by twitter, how to create a Twitter Developer Account and using python to create your own twitter bot. Best part of the article is that it explains what you are doing as well. I highly recommend following the step by step approach to create your own twitter bot for like, follow, retweet, reply, etc.

Once you have created the bot on your system, you would realize that the twitter bot only runs when your system is switched on. To solve that issue you can deploy the twitter bot on a server. That is where I found the above article’s limitation. I don’t know what a Docker is. I didn’t understand a word after that but I lived to fight another day and so will you as you continue to read this post.

How to Ensure that Twitter Bots Runs 24x7?

If you are an experienced coder/developer, then you shouldn’t be reading my blog for creating twitter bots in the first place. For my target audience, I found a better way to run my Twitter Bot 24×7. I watched this Youtube Video and it worked like a charm. This video is to be watched after you have created your Twitter Bot.

In short you would have to create an account on Github (to open source your code) and Heroku (to use Heroku’s server to deploy your twitter bot). The above video had two major limitations. One where the creator is using Git terminal to share the code on Github and second assuming that the viewers already know what they are doing. I made a few mistakes but I want to ensure that you do not repeat the same. So here are a few things that should have been mentioned by the creator:

  • A simpler way to ‘push’ files on Github is to use ‘Add Files’ feature of Github website rather than installing Git in your system and learning a new syntax.
  • ‘Procfile’ doesn’t have any file extension. Create a file Procfile.txt, add the code mentioned in the video, save the file and then rename to ‘Procfile’
  • If you are using Jupyter Notebook, convert ‘ipyub’ to ‘py’ before uploading on Github
  • Add a sleep timer in your code since the free server can allocate only a specific amount of time for your bot
  • Every time you want to make a change in your code, you have to reupload on Github and redeploy on Heroku

Now that your Twitter Bot is up and running, only thing left to learn is how to use the Twitter Bot for ersonal brand engagement.

How to use the Twitter Bot for Personal Brand Engagement?

Our aim is to increase engagement of the Bot Account and filter some of the followers to your Original Account. The filter is necessary otherwise the Original Account would be spammed and you don’t want to turn your Twitter into Facebook.

  1. Create a Bot account which retweets tweets containing the term you want to be associated with (e.g.: MarketingTwitter, Football, Books, etc)
  2. Follow only one account, the ‘Original Account’, via the Bot account
  3. Mention the Original Account in the bio of the Bot account
  4. Retweet all the tweets of Original Account by Bot Account
  5. Wait! 
  6. Wait!
  7. Wait!

That’s it. Wait and remember that social media following follows a ‘S’ curve. Most prolific Twitter users tweet 138 times a month. Your Bot can engage with a user every second (though I have timed My Bot to retweet at a random interval of 30 to 60 minutes since I don’t want to spam the followers). At minimum My Bot will retweet 720 tweets in a month and 8640 tweets in a year, connecting My Bot with 8640 twitter accounts which have used the term ‘MarketingTwitter’ – a term to used by marketing professionals all over the twitter world.

Don’t wait for six months to pass to think I should have done that six months ago. If right now, you are thinking that making a personalized Twitter Bot is a good idea, start making it today. If you need any assistance you can reach me via Twitter/LinkedIn

If you are reading this post because you read about Twitter Bots somewhere, then we have come full circle. Just like how I created a Twitter Bot that retweets ‘original tweets’ containing the term ‘MarketingTwitter’ because of a retweeting bot. Or just like how I was watching Bobby Fischer’s Saga by Adagmator, then Chess’s popularity bumped up because of Queen’s Gambit’s releasing on Netflix on 23th October 2020. There is a brief mention about José Raúl Capablanca which lead to Youtube recommending me Jose Raul Capablanca Saga by Adagmator because I was watching Bobby Fischer’s Saga. And now I am watching Queen’s Gambit.


Note: In case you are looking for a Product Management course, I would highly recommend joining this cohort-based course – ISB Executive Education – Product Management program

PS: You can connect with me for review or referral discount (link for referral discount)

Opinions are my own and not the views of my employer (if any)

When I am not working/watching movies/reading books/traveling, you can reach me via my Twitter/LinkedIn or you can contact me here

Categories: Product Management