GithubHelp home page GithubHelp logo

dtreichler / automoderator Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 32.0 609 KB

A bot for automating straightforward moderation tasks on reddit

Home Page: http://www.reddit.com/r/AutoModerator

Python 100.00%

automoderator's Introduction

Introduction

This is a bot for reddit, meant to automate straightforward moderation tasks by automatically performing actions based on defined conditions. For a large description of why this bot was created and what it does, please see this post I made about it on reddit.

If you'd like to utilize this functionality without running your own instance, just add AutoModerator as a mod to any subreddits you'd like to use it in, and send a message to me (Deimorz on reddit) explaining the conditions you'd like set up.

Disclaimer

This code has been made public largely for the purpose of displaying exactly what AutoModerator does, and as an example for others working on reddit bots (moderation-related or otherwise). It may be difficult for others to get functional. Use at your own risk.

Requirements

Setup

Copy modbot.cfg.example to modbot.cfg and edit values to match your desired database and reddit account. You can have SQLAlchemy create the tables for you by importing models.py into a Python interpreter session and calling db.create_all().

Add the bot's account as a moderator to any subreddits you want it to check, then add those subreddits to the subreddits table and the desired conditions to conditions. (See below for examples of conditions)

I run it using a cronjob that checks through the list of subreddits every 5 minutes, but it would also be possible to run in an infinite loop, so that each subreddit is checked as often as possible.

Condition Examples

Remove submissions using common URL-shorteners

  • subject = submission
  • attribute = domain
  • value = (bit\.ly|goo\.gl|tinyurl\.com|t\.co|tiny\.cc)
  • action = remove

Approve self-posts by not-extremely-new users

  • subject = submission
  • attribute = domain
  • value = self\.subredditname
  • account_age = 3
  • combined_karma = 10
  • action = approve

Allow only submissions from reddit.com and self-posts (e.g. /r/bestof)

Condition #1

  • subject = submission
  • attribute = domain
  • value = (reddit\.com|self\.bestof)
  • action = approve

Condition #2

  • subject = submission
  • attribute = domain
  • value = (reddit\.com|self\.bestof)
  • inverse = true
  • action = remove

automoderator's People

Contributors

deimos avatar dtreichler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.