Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
StackBot is a reddit bot that replies to comments that link to StackOverflow with the body of the linked/accepted/highest ranked answer.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
README.md
main.py
remover.py

README.md

StackBot

StackBot is a reddit bot that replies to comments that link to StackOverflow with the body of the linked/accepted/highest ranked answer.

Installation

git clone git://github.com/gabrieldain/StackBot
cd StackBot
mkdir logs
mkdir logs/remover
touch already_done
touch user_pass

Edit user_pass with your username and password.

You might want to edit main.py and remover.py to alter logging behaviour. See docstrings for further information about this.

Behaviour

StackBot is really two bots: a comment creator and a comment remover. They work concurrently and independently of each other.

Commenter

main.py controls the comment-creator. It scans /r/all for comments that include the regex r'stackoverflow.com/(q|a|questions)', then replies with an answer from the linked page.

The answer hierarchy is as follows: linked answer > accepted answer > answer with highest votes.

Remover

remover.py controls the comment-remover. It scans comments by user 'StackBot', and checks their age and score. If any comment were to fall below 0 score, and be older than the average length of time between comments being posted in the relevant subreddit, the comment will be removed permanently.

The age-aware behaviour is intended to balance the bots behaviour: delete-happy in subreddits with heavy traffic, while giving the comment a chance to get some upvotes in less frequented subreddits. Overall, it makes StackBot less spammy.

Something went wrong with that request. Please try again.