This module implements a super simple rss feed Slack integration that posts a
notification to a Slack group channel when new posts are added to the feed.
The module is a thin wrapper around the excellent
rss-watcher module. It essentially
uses the rss-watcher's new article
event to fetch the article title and url,
and does a post request to a given Slack group's incoming web hook URL with a
message consisting of the article title and url.
Installation
Simply install in project using npm install --save rss-slack-integration
.
Usage and Configuration
The module is very simple. It exposes a single function start
which expects a
configuration object as its sole parameter.
Example usage:
var rsi = require("rss-slack-integration");
rsi.start({
feed: "https://example.com/rss",
interval: 60,
slackHook: "https://hooks.slack.com/services/yourservicehash",
slackIcon: "https://example.com/icon.png",
slackBotUser: "Bot Username"})
The feed
property should be the URL of the rss feed you want to receive
updates about. Take care to provide the protocol part of the URL. The interval
property specifies the number of seconds between each poll of the rss feed.
Setting this to 60
means that the rss-watcher
module will poll the
rss-feed for changes once a minute.
The slackHook
property should be set to whatever URL was generated by Slack
when you created the
incoming webhook. The slackIcon
property should be set to the URL of the icon you want to use for the Slack
bot. The last property, slackBotUser
should be set to whatever bot name you
want your Slack web hook messages to appear under, for example the name of the
rss feed's site.
Issues and contributions
If you experience any issues with this module you can submit issues at the
project's Github Repository.
Any help towards improving this module is welcome. If you want to add features
or fix bugs you are welcome to submit a
pull request.
License
This project is licensed under MIT. See the
LICENSE file.