Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Slack bot for posting dank memes from Reddit

Project Description
# Dankbot

[![Circle CI](https://circleci.com/gh/DankCity/dankbot/tree/master.svg?style=svg)](https://circleci.com/gh/DankCity/dankbot/tree/master) [![Coverage Status](https://coveralls.io/repos/github/DankCity/dankbot/badge.svg?branch=master)](https://coveralls.io/github/DankCity/dankbot?branch=master) [![Code Health](https://landscape.io/github/DankCity/dankbot/master/landscape.svg?style=flat)](https://landscape.io/github/DankCity/dankbot/master) [![Stories in Ready](https://badge.waffle.io/DankCity/dankbot.svg?label=ready&title=Ready)](http://waffle.io/DankCity/dankbot)

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 git@github.com:DankCity/dankbot.git
```

### 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
[slack]
token: <put here>
channel: #random

[reddit]
subreddits: dankmemes, fishpost, me_irl, 4chan

[imgur]
client_id: <client_id>
client_secret: <client Secret>

[mysql]
database: <db>
username: <username>
password: <password>

[misc]
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.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# 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
Release History

Release History

This version
History Node

0.0.3

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dankbot-0.0.3-py3-none-any.whl (13.9 kB) Copy SHA256 Checksum SHA256 py3 Wheel Dec 6, 2016
dankbot-0.0.3.tar.gz (27.2 kB) Copy SHA256 Checksum SHA256 Source Dec 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting