Skip to content

SwarajSalesforce/twitter-slack-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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.

About

Stream tweets to Slack with the greatest of ease!

Resources

License

Stars

Watchers

Forks

Packages

No packages published