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”,”",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 if you have any questions.

from googletrans import Translator import feedparser

from dateutil import parser import dateparser
import slack
from datetime import datetime
import pytz
from html.parser import HTMLParser

def strip_html(text): parts = []
parser = HTMLParser()
parser.handle_data = parts.append
return ‘’.join(parts)

def quick_slack(channel, text): token=”YOUR API TOKEN”
slacker = slack.WebClient(token)
slacker.chat_postMessage(channel=channel, text=text)

def get_simple_feed(date_file,feed, channel,heading): d =…

John Biggs

Writer And Entrepreneur


See more recommendations