Stream tweets to Slack with the greatest of ease!
This was created as an easy way to monitor tweets containing specific keywords from a Slack channel in realtime.
It's been designed to be super easy to deploy via Heroku.
You can deploy it anywhere Node.js is installed.
- Twitter application
- Incoming Slack webhook
- Keyword to search on Twitter
- Slack channel to stream tweets into
- Head to apps.twitter.com
- Create a new application
- Give it whatever name/description you like
- Callback URL doesn't matter and can be blank
- Navigate to the "Keys and Access Tokens" tab of your newly created app
- Record the
Consumer Key
andConsumer Secret
for later use - Scroll down to "Your Access Token", and click the "Create my access tokens" button
- Record the
Access Token
andAccess Token Secret
for later use
- Head to Slack Integrations
- Create a new incoming webhook
- Record the webhook URL for later use
Now that you have all of the required secrets, you're ready to deploy!
The application requires the following environment variables:
Environment Variable | Description |
---|---|
SLACK_CHANNEL_NAME |
Slack channel to stream incoming tweets into |
SLACK_CLIENT_ID |
Slack App client ID |
SLACK_CLIENT_SECRET |
Slack App client secret |
SLACK_WEBHOOK_URL |
Slack incoming webhook URL |
SLACK_VERIFICATION_TOKEN |
Slack verification token |
TWITTER_SEARCH_STRING |
the keyword to look for on the Twitter firehose |
TWITTER_CONSUMER_KEY |
the key for your Twitter application |
TWITTER_CONSUMER_SECRET |
the secret for your Twitter application |
TWITTER_ACCESS_TOKEN |
the token for authorizing your app to use your twitter account |
TWITTER_ACCESS_SECRET |
the accompanying secret for your twitter account's use of the app |
To launch, simply execute npm start
, or deploy to Heroku where it just works automagically (via Procfile
)!
Heroku note: Don't forget to run heroku ps:scale web=0 worker=1
to get Heroku to run the worker dyno.