Name: nyt-scotusbot
Owner: NYT Newsroom Developers
Description: A SlackBot for notifying NYTimes reporters and editors about changes to the Supreme Court's docket, grants and orders.
Created: 2015-10-06 12:07:32.0
Updated: 2017-11-19 02:03:11.0
Pushed: 2016-01-26 05:02:58.0
Homepage: null
Size: 15
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Python-based SlackBot derived from SlackHQ's remarkable RTMBot
This bot uses MongoDB instead of the filesystem for persistence. You can install MongoDB locally (default) or export SCOTUSBOT_MONGO_URL
with your custom connection string.
install mongodb
sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
chctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Create a virtualenv and install the required packages.
rtualenv nyt-scotusbot && pip install -r requirements.txt
Create a bot integration for your scotusbot and get the channel ID. Then export the channel ID and the token.
rt CAMPFINBOT_SLACK_CHANNEL=C012345
rt CAMPFINBOT_SLACK_TOKEN=ABCEFGHIJKLMNOPQRSTUVWXYZ01234567890
Create the log file if it doesn't exist.
h /tmp/scotusbot.log
Preload data for the bot. It needs to get loaded with old cases (grants and opinions) so it doesn't spam your slack channel with stuff you already know about.
on -m scotusbot.preload
Run the bot itself.
on -m scotusbot.bot
Tail the log to see what's going on.
-f /tmp/scotusbot.log
/etc/init/scotusbot.conf
and use this template.t on runlevel [2345]
on runlevel [!2345]
respawn
script export SCOTUSBOT_SLACK_CHANNEL='C012345' export SCOTUSBOT_SLACK_TOKEN='xoxb-1234567890-AbcDefGhijkLmNOpQRstUvWXyz' export SCOTUSBOT_PRD_HOST='ec2-0-0-0-0.compute-99.amazonaws.com' export SCOTUSBOT_MONGO_URL='127.0.0.1:12345' cd /home/ubuntu/nyt-scotusbot && /home/ubuntu/.virtualenvs/nyt-scotusbot/bin/python /home/ubuntu/nyt-scotusbot/scotusbot/bot.py end script