Build an RSS to Slack bot

John Biggs
2 min readMay 24, 2019

Building a Slackbot is surprisingly easy and I wanted one that would send RSS feeds to a special room. This, I discovered, was a bit hard. This is why I wanted to share some of my work here.

The first trick is to get your Slack API key. This is found here and requires you create a Bot user and then grab the key. It is a fairly long string and starts with “xoxp.”

The instructions for API key generation are here.

Once you have your token, simply place it in the code below where it says “YOUR API TOKEN.” You can then select a channel to notify.

channel=”#newsroom” simple_feed(“litrelease.txt”,”https://www.sec.gov/rss/litigation/litreleases.xml",channel,"SEC Litigation”)

I’ve made this system as simple as possible and all of the necessary data is stored in text files. This could be improved considerably but it works for now. I’ve also tried to manage for different types of RSS feeds but some of them are very messy and so I created a few small error-detection routines to keep things moving.

Again, this is a very rudimentary system that sends new news to the selected channel. Code is below and email us at team@visiblemagic.com if you have any questions.

--

--

John Biggs

John Biggs is an entrepreneur, consultant, writer, and maker. He spent fifteen years as an editor for Gizmodo, CrunchGear, and TechCrunch.