There appears to be demand for a bot to prevent specific users from being able to post in self moderated threads.
As such, I am releasing a bot to self moderator bot that bans specific UIDs from posting in your self moderated thread.
You can run the bot by performing the following steps:
- Install prerequisites*
- Create text file (name cannot have spaces), and change file name extension to .py
- Past code into text file
- enter the captcha bypass URL, your forum username, thread you are moderating, and list of UIDs you are banning from posting in your thread into the file in their respective variables
- If you are not using a mac, comment out line 26, and uncomment the line below the OS type you are running; save the file
- Open terminal (or gitbash if using Windows), navigate to the folder the file is in
- In the terminal, type python file_name.py
- If you named the file 'self_moderator.py' you would type python self_moderator.py
- the terminal will ask for your forum password, type your forum password and press enter
- Note: your password will only be transmitted to the forum to login, and the code does not otherwise retain or transmit your password to anywhere else (as written)
- If you did everything correctly, the bot will review your self moderated thread every 10 seconds (by default), and remove any posts by anyone you have banned from your thread
Prerequisites:
Python
The following python libraries: splinter bs4 (beautifulsoup) selenium numpy datetime time warnings
Chrome
Chromedriver -- you can find documentation on how to install
chromedriver here.
The bot was tested using version 3.7 of python, and I am unsure if it will work on older versions
If you don't want Chrome to display in the backgroud while your bot is running, you can change line 48, specifically the variable 'headless' from False to True
My bot has a MIT license, however by using my bot, or by using any bot derived from my bot, you are agreeing and promising that you will not take steps to prevent the subject of your self-moderated thread from posting in your thread. In other words, if you are using my bot, you must allow any person who is the subject of your self-moderated thread to respond to your thread.
I have posted my code on
github and is below:
Cloud Flare appears to be preventing me from posting my code here
Comments and suggestions for improvements are welcomed.
If there is demand, I could add functionality to also prevent ranks, or those with under certain activity or merit from posting.