This integration service posts RSS feeds into specific Mattermost channels by formatting output from html to text via Mattermost's incoming webhooks.
To run this integration you need:
- A network connected device running python like Raspberry Pi or any other Linux device which supports python and the required packages
- A Mattermost account where incoming webhooks are enabled
The following procedure shows how to install this project on a Linux device running Ubuntu 14.04. The following instructions work behind a firewall as long as the device has access to your Mattermost instance.
To install this project using a Linux-based device, you will need Python 2.7 or a compatible version. Other compatible operating systems and Python versions should also work.
Here's how to start:
-
Set up your Mattermost instance to receive incoming webhooks
- Log in to your Mattermost account. Click the three dot menu at the top of the left-hand side and go to
Account Settings > Integrations > Incoming Webhooks. - Under Add a new incoming webhook select the channel in which you want Feed notifications to appear, then click Add to create a new entry.
- Copy the contents next to URL of the new webhook you just created (we'll refer to this as
https://<your-mattermost-webhook-URL>
).
- Log in to your Mattermost account. Click the three dot menu at the top of the left-hand side and go to
-
Set up this project to run on your Linux device
- Set up a Linux Ubuntu 14.04 server either on your own machine or on a hosted service, like AWS.
- SSH into the machine, or just open your terminal if you're installing locally.
- Confirm Python 2.7 or a compatible version is installed by running:
python --version
If it's not installed you can find it here - Install pip and git:
sudo apt-get install python-pip supervisor git python-virtualenv
- Clone this GitHub repository:
git clone https://github.com/bitbackofen/Rss-Atom-Feed-Integration-for-Mattermost.git
cd Rss-Atom-Feed-Integration-for-Mattermost
- Copy sample file
settings.py.sample
:
cp settings.py.sample settings.py
- Edit
settings.py
to suit your requirements:
nano settings.py
Save your changes (F2) and exit nano (CRTL-X) - Setup virtual environment:
virtualenv -p python2 env
source env/bin/activate
(env) $ pip install -r requirements.txt
Leave virtual environment:(env) $ deactivate
- Test the the feed fetcher:
./env/bin/python ./feedfetcher.py
You should see your feeds scrolling through. Check your configured Mattermost channel for the new feeds.
If everything works fine: - a) Start feedfetcher with nuhup:
nohup ./env/bin/python ./feedfetcher.py &
b) Alternatively: Start feedfetcher with Supervisor:sudo cp Rss-Atom-Feed-Integration-for-Mattermost.conf.sample /etc/supervisor/conf.d/mRss-Atom-Feed-Integration-for-Mattermost.conf
- Edit the supervisor configuration file:
sudo nano /etc/supervisor/conf.d/Rss-Atom-Feed-Integration-for-Mattermost.conf
and change paths incommand=
anddirectory=
to suit your environment. - Tell Supervisor to look for any new or changed program configurations:
sudo supervisorctl reread
- Followed by telling it to enact any changes with:
sudo supervisorctl update
Refer to this tutorial for more information about Supervisor.
This integration also works with Microsoft Windows:
- Download Python 2.7 from Python.org and install it
- Download mattermost_integration_rss from Github or get it using
git clone https://github.com/bitbackofen/Rss-Atom-Feed-Integration-for-Mattermost.git
- Extract the archive to a directory of your choice if you downloaded archive.zip.
- Start a command prompt and cd into your Python installation directory: e.g.
cd c:\python27
- Install requirements using
Scripts\pip.exe install -r \path\to\Rss-Atom-Feed-Integration-for-Mattermost\requirements.txt
cd \path\to\Rss-Atom-Feed-Integration-for-Mattermost\
- Start the Script:
C:\Python27\python.exe feedfetcher.py
(changeC:\Python27\
if you installed Python elsewhere).
- cd into your mattermost_integration_rss directory:
cd /path/to/Rss-Atom-Feed-Integration-for-Mattermost
- Stop feedfetcher:
sudo supervisorctl
supervisor> stop Rss-Atom-Feed-Integration-for-Mattermost
Exit supervisor (CRTL-c) - Update mattermost_integration_rss
git pull origin master
- Have a look at
settings.py.sample
for changes. - Start the feedfetcher:
sudo supervisorctl
supervisor> start Rss-Atom-Feed-Integration-for-Mattermost