Skip to main content

Slack bot for posting dank memes from Reddit

Project description


PyPIVersion CircleCI CoverageStatus Code Health StoriesInReady

A Slack Bot that scrapes memes from subreddits and posts them to slack

Steps to run

Clone into directory

cd /opt
sudo mkdir dankbot && sudo chown <user>:<user> dankbot
git clone

Setup INI file

cd /opt/dankbot
cp dankbot/dankbot.ini.sample dankbot/dankbot.ini

Edit the INI file to fill in the missing token, username, and password fields:

(.venv35)➜  dankbot git:(master) ✗ cat dankbot/dankbot.ini.sample
token: <put here>
channel: #random

subreddits: dankmemes, fishpost, me_irl, 4chan

client_id: <client_id>
client_secret: <client Secret>

database: <db>
username: <username>
password: <password>

include_nsfw: <boolean>
max_memes: 3

Create and activate a virtual environment

cd /opt/dankbot
virtualenv --python=`which python3` env
source env/bin/activate

Install the python package

cd /opt/dankbot
source env/bin/activate
pip install -e .

Create logging folder

sudo mkdir /var/log/dankbot
sudo chown <user> /var/log/dankbot

Add an entry to your crontab

Edit the crontab with your favorite editor

sudo vi /etc/crontab

And add an entry like so:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the 'crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.


# m h dom mon dow usernamecommand
*/5 09-17 * * 1-5 root cd /opt/dankbot && source env/bin/activate && dankbot .

This will run dankbot once every 5 minutes, Monday to Friday, between 9 AM and 5 PM CST

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dankbot, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size dankbot-0.0.5-py3-none-any.whl (14.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dankbot-0.0.5.tar.gz (27.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page