StackBot is a reddit bot that replies to comments that link to StackOverflow with the body of the linked/accepted/highest ranked answer.
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.
StackBot is really two bots: a comment creator and a comment remover. They work concurrently and independently of each other.
main.py controls the comment-creator. It scans /r/all for comments that include
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.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.