1.0.2 • Published 7 years ago

twitter-slack-stream v1.0.2

Weekly downloads
2
License
ISC
Repository
-
Last release
7 years ago

twitter-slack-stream

Stream tweets to Slack with the greatest of ease!

About

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.

Requirements

  1. Twitter application
  2. Incoming Slack webhook
  3. Keyword to search on Twitter
  4. Slack channel to stream tweets into

Configuration

Twitter

  1. Head to apps.twitter.com
  2. Create a new application
  3. Give it whatever name/description you like
  4. Callback URL doesn't matter and can be blank
  5. Navigate to the "Keys and Access Tokens" tab of your newly created app
  6. Record the Consumer Key and Consumer Secret for later use
  7. Scroll down to "Your Access Token", and click the "Create my access tokens" button
  8. Record the Access Token and Access Token Secret for later use

Slack

  1. Head to Slack Integrations
  2. Create a new incoming webhook
  3. Record the webhook URL for later use

Deployment

Now that you have all of the required secrets, you're ready to deploy!

The application requires the following environment variables:

Environment VariableDescription
SLACK_CHANNEL_NAMEthe name of the Slack channel to send incoming tweets to
TWITTER_SEARCH_STRINGthe keyword to look for on the Twitter firehose
CONSUMER_KEYthe key for your Twitter application
CONSUMER_SECRETthe secret for your Twitter application
ACCESS_TOKENthe token for authorizing your app to use your twitter account
ACCESS_SECRETthe 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.