This project has been archived due to Twitter changing their API. This does not work anymore, and probably never will unless you have a paid subscription. Twitter, f you.
A Twitter bot to trigger a webhook when a new tweet is sent by a user, using twit
and node-fetch
.
You may modify the body
to customize what is being set to the webhook. Currently, it sends the link to the tweet, with the username and profile picture of the user.
-
Clone the repository.
-
Run
npm i
. -
Create a copy of
cfg.example.json
andtwitcfg.example.json
, and remvoeexample
from the filename. These are your configuration files. -
Go to the Twitter Developper Portal, and create an app.
-
Save your API key and API secret key to
twitcfg.json
. -
In the Keys And Tokens tab, generate an access token (read only). Save these to
twitcfg.json
. -
Add the webhook URL you want the messages to go to in the
webhook_url
field. Add the users you want updates on to theusers
array. -
Run the bot :
node index.js
.