juliessantiago / rssToSlack

A JavaScript app that reads a set of feeds and posts the new items to a Slack channel. Runs in Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rssToSlack

A JavaScript app that reads a set of feeds and posts the new items to a Slack channel. Runs in Node.js.

How to

  1. Be sure Node is installed.

  2. Download the folder.

  3. At the command line, in the folder: npm install.

  4. Edit config.json to set it up (see below).

  5. At the command line: node rsstoslack.js.

Getting your WebHook address

The only tricky part of the setup is to get a magic URL from Slack that enables rssToSlack to send messages to your channel.

If you click on this link, it will redirect to your Incoming Web Hooks page.

  1. Choose a channel from the popup menu.

  2. Click the big green button, which takes you to a page with a long URL on it.

  3. Copy the URL to the clipboard.

config.json

The feeds array can have as many elements as you want. rssToSlack will read each feed once a minute, and post a new item to the slack channel you specify.

  1. Give your feed a unique name (that is don't give two feeds the same name).

  2. Set enabled to true (this is present so you can disable a feed without removing it from the array).

  3. Provide the URL of the RSS feed.

  4. Provide information about the Slack channel. Most important provide the URL of the web hook (see above). You can also specify a name for the hook, an icon, or an emoji character.

Updates

v0.44 -- 6/3/15 by DW

Fixed a problem that would cause rssToSlack to stop checking feeds if there was an error. We now check to see if everyMinute is still active in the everySecond script. If not, we restart the chain of calls.

v0.43 -- 6/2/15 by DW

Read config.json once a minute so you don't have to reboot the app to change the configuration.

Structured code

You can review the structured version of the code, it might make a little more sense this way. ;-)

Questions, comments?

Please post a note on the Server Snacks mail list.

About

A JavaScript app that reads a set of feeds and posts the new items to a Slack channel. Runs in Node.js.

License:MIT License


Languages

Language:JavaScript 100.0%