Remixed from https://glitch.com/edit/#!/twitterbot-webhooks
This is a template for making fun Twitter bots with Glitch and the Twit node.js library. It uses the new Twitter Webhooks API.
While this API is in beta, you need to get your Twitter application whitelisted and the API only supports delivery of Direct Messages.
- First, create a new Twitter account and a new Twitter app. (This tutorial shows how.)
- Update the
.env
file with your Twitter API key/secrets. (The tutorial above explains how to get these.) 2a. Update the URL to the running Glitch app at line 46/47 so that the Webhook can be registered successfully - Update
server.js
with some cool Twitter bot code. (The included example simply responds to every DM with "Hello 👋".) - Open your project's page (it looks like https://PROJECT-NAME.glitch.me) and click Register webhook.
- Your bot can now respond to DMs!
Also, for your convenience, your project's log will show your bot's activity.
Check out the Twit module documentation for more examples of what your bot can do.
You can find more tutorials and open source Twitter bots on Botwiki.
And be sure to join the Botmakers online hangout and submit your bot to Botwiki :-)
Powered by Glitch
\ ゜o゜)ノ