Creating a Twitter bot with Node.js
This tutorial will show you how to create a simple twitter bot that tweets at users that have tweeted public tweets with certain keywords. It will also tweet normal tweets randomly at configurable intervals.
NOTE: This tutorial assumes you have node, npm, and git installed. If you don’t have these tools install them first.
Open a terminal window and enter the following command:
Install the dependencies:
Now open the twit_config.json in your favorite editor:
Set the twit_data information to your twitter information (consumer key, consumer secret, access token, access token secret). If you don’t know this info visit https://dev.twitter.com/apps/new.
Set the phrases array to the random phrases you want your bot to tweet. For example:
The twitter bot script will search public tweets for a specific phrase. Enter this phrase under search_phrase.
Enter your bot’s screen name under bot_screen_name.
Now you’re all set! Run the twitter bot with:
You can follow me on twitter at @klopkev.