This is a framework for creating simple Twitter bots in node. It uses the straightforward Twit library to access Twitter's streaming API.
git clone https://github.com/rfreebern/simple-twitter-bot.git && cd simple-twitter-bot && npm install
- Create an application on http://dev.twitter.com
- Generate the necessary tokens: https://apps.twitter.com/
Copyconfig.js-dist
toconfig.js
- Put your tokens in
.env
- Put some keywords for your bot to follow in the
keywords
array inconfig.js
bot.js
Add whatever logic you want to thevalid
andresponse
functions inconfig.js
- Install Heroku Foreman.
- Run
node bot.js > output.log &
foreman start web
To the extent possible under law, Ryan Freebern has waived all copyright and related or neighboring rights to this work. CC0