ThisIsARepostBotBot
So you found a repost bot, now what?
This is a bot to reply to all posts of a repost bot with a message urging users to report and down vote, It can also report posts. (You may want a burner account for this.)
Requirements
A reddit account with a added script.
To add a script to your reddit account, go to https://old.reddit.com/prefs/apps, click "create (another) app", select "personal use script", and enter "http://localhost/" as the redirect uri.
(Keep the page open, you will need the client secret and client id values to configure the script)
pip
-
praw
-
mariadb
DB
This uses an MySQL/mariadb database to store lists of bot users and keep track of reported posts.
You can create the required table structure like this:
create database repost;
use repost;
create table bots (username: varchar(60), notes: varchar(256), dontflag BOOL, mladd BOOL); -- Add known bot accounts in here
create table reported_posts (id: varchar(10)); -- ids of posts that the bot has reported
create index id on reported_posts (id);
create table sub_blacklist (name: varchar(20)); -- Add subreddits without the 'r/' that you do *not* want to post on.
create table known_comments (id VARCHAR(10), text TEXT, parent VARCHAR(10), username VARCHAR(64), hasbeenuserscraped BOOL); -- comments made by botx
create table comments (id VARCHAR(10), text TEXT, parent VARCHAR(10), username VARCHAR(64));
create table nonbots (username VARCHAR(64));
Configuration
The main configuration file is "config.json", a template file is provided, "config.json.exmple".
You will have to add the usernames of the repostbots into the bots
table.
Running
just python3 bot.py
Other scripts in repo
scrapers/get_bot_comments.py
Pulls the comments of all bots from reddit.
scrapers/get_bot_posts.py
Pulls the posts of all bots from reddit.
corelation/find_more.py
Attempts to use the comment db to find other bot users running on the same instance, Promping the user to check if they are bots.
This requires get_comments.py
to be run