Twitter Bots can do interesting things. You can tweet questions like “how many calories are in diet coke” to @DearAssistant and the Twitter bot, like Google Now or Apple Siri, will reply with the answer. The @HundredZeros bot tweets links to eBooks that are free on Amazon. Another Twitter bot @WhatTheFare will tell you the Uber fare between two locations.
A bot is a program that runs in the background and, when it encounters a command, it performs some action. For instance, you can have a grammar bot that looks for tweets containing misspellings and tweet the correct spelling.
A bot can automatically favorite or retweet tweets that match certain criteria. It can follow Twitter user who have tweeted a particular phrase. A brand may build an auto-reply bot that automatically responds when the brand gets a @mention on Twitter. You may have a bot that auto-sends a DM (direct message) to users who follow you on Twitter.
Writing a Twitter bot is easy and you can get one up and running in 5 minutes. Our Twitter bots run on Google servers and you don’t need any coding skills to create the bot. The bots are internally written using Google Scripts.
How to Create your own Twitter Bot
The basic idea behind bots is simple. You specify a search phrase and choose an action. The bot will find all tweets that match the search phrase and perform the associated action on those tweets.
Step A: Make an App for the Twitter Bot
- Create a new account at Twitter that will work as a bot. Then go to apps.twitter.com, sign-in with your new Twitter account and create a Twitter app. Give your app a name, description and put any URL in the website field. Agree to the developer terms and submit the form.
- Once the Twitter app has been created, click Modify App Permissions under Application Settings and change the access level to Read, Write and Access Direct Messages.
- Next switch to the Keys and Access Tokens tab and click the Create my Access Token button. Twitter will generate the Consumer Keys and Access tokens that we will need in a next step.
Step B: Configure your Twitter bots
- Go to labnol.org/bot to open the Twitter bots application. You may have to authorize the bot once.
- Edit the values of Twitter Consumer Key, Consumer Secret, Access Token and Access Secret that were generated in the previous step.
- Next you need to specify the search phrase for the bots. The app will find all new tweets that match this search phrase and process them all, one at a time. If you have the premium version, you can create up to 5 bots in one go.
- Click the Create to initialize the Twitter bot. That’s it. The bots are now initialized and they’ll auto-run in the background.
Twitter Bots Video Tutorial
Please watch the Twitter Bots Video Tutorial (download) for a more detailed getting started guide. It is important to note that Twitter TOS discourages automation so you may want to test the waters with a test Twitter account.
You can use Twitter search operators to find more specific tweets for processing through bots. For instance, use min_faves or min_retweets operator to filter out spammy tweets from search results. Here are some area where bots are handy:
- If you are changing your Twitter username, set an auto-DM bot for the old account so followers can know about your new screen name.
- If you are offline during specific hours, setup out of office replies so people can expect a delayed response.
- Follow users or add them to a Twitter list who tweet on particular topics.
Twitter Bots – Unlock Premium Features
The Twitter bot is available in free and premium editions. The latter includes more features and you are entitled to technical support for 3 months.
Features | Free | Premium |
---|---|---|
Favorite Tweets | Yes | Yes |
Retweet Tweets | Yes | Yes |
Auto-Reply to Tweets | Yes | Yes |
Emoji Support | Yes | Yes |
Run bot at specific time | Yes | Yes |
Follow Users | No | Yes |
Add Users to Twitter List | No | Yes |
DM New Followers | No | Yes |
Reply via DMs (to users who allow) | No | Yes |
How often do the bots run? | Once per hour | Every 15 minutes |
How many Twitter bots can be created? | One | Five |
Support options | None | |
Buy Premium Edition |
The story, How to Write a Twitter Bot in 5 Minutes, was originally published at Digital Inspiration by Amit Agarwal on 09/04/2016 under Twitter, Internet.