Update README.md
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m17s

This commit is contained in:
retoor 2024-12-19 16:09:56 +01:00
parent d347c585ad
commit d199164d45

View File

@ -1,12 +1,10 @@
# Ragnar # Ragnar Bot: Automated Moderation System for Devrant.io
This is an anti spam bot network. It is named after the viking for no obvious reason. ## Overview
Ragnar Bot is an automated system designed to interact with the **Devrant.io API** for community moderation. It detects spam, flags inappropriate content, and takes corrective actions such as downvoting and commenting. The system is scalable, customizable, and supports concurrent operations for multiple users.
This bot network works great and is made not to be annoying to the server by not connecting all at once. It's caching certain things like user profile / resolved user id's and if a rant already is flagged for example. ## Fan-art
This is some fan art made by Buffon, a contributor of this project:
The bot network removes spam before users of the development community even notice.
Here's some fan art made by Buffon, a contributor of this project:
![Image generated by Buffon](buffon.jpg) ![Image generated by Buffon](buffon.jpg)
@ -18,18 +16,70 @@ Third one, the legendary bot war of 2024 ended in peace.
![Image generated by Buffon](buffon3.jpg) ![Image generated by Buffon](buffon3.jpg)
## How they work
One process starts many bots. These bots look at new rants.
If there is a new rant: ---
1. Check if user has more than five posts. If so, it will not be seen as spam.
2. It will check certain keywords like hacker / money crypto related. ## Features
3. User will be informed by the bot network that his rant is flagged and what to do about it.
4. Rant will be downvoted by the bot network making it disappear. ### API Integration
- **User Authentication**: Secure login with credentials.
- **Profile Retrieval**: Access user profile data.
- **Content Search**: Find posts matching specific keywords or patterns.
- **Comments Management**: Post and fetch comments on rants.
- **Voting System**: Upvote or downvote rants programmatically.
- **Fetch Rants**: Retrieve and sort recent rants for analysis.
### Spam Detection
- **Keyword Triggers**: Detect spam using predefined keywords like `crypto`, `bitcoin`, and more.
- **Regex Matching**: Identify suspicious patterns in text, such as URLs or phone numbers.
- **Heuristic Checks**: Evaluate user profiles and comments for unusual behavior.
### Automation
- **Flagging Spam**: Automatically downvote and comment on posts flagged as spam.
- **Concurrent Execution**: Operates multiple bots simultaneously using multithreading.
- **Customizable Triggers**: Adjust detection patterns to fit evolving spam trends.
### Logging & Caching
- **Logging**: Outputs activity logs to both the console and a file for debugging and monitoring.
- **Caching**: Uses a custom caching system to optimize performance and reduce redundant operations.
---
## How It Works
### Components
1. **API**:
Handles all interactions with the Devrant.io platform, including user authentication, content retrieval, and posting actions.
2. **Bot**:
Implements moderation logic:
- Identifies suspicious content.
- Posts comments warning users about flagged content.
- Maintains a history of checked rants to avoid redundant processing.
3. **CLI**:
Command-line interface to configure and execute the bot. Accepts user credentials and runs bots for multiple users simultaneously.
4. **Victoria Integration**:
Fetches user-related data from a remote service (`victoria.molodetz.nl`) for enhanced operations.
### Workflow
1. The bot authenticates using the provided username and password.
2. It retrieves and evaluates recent rants for spam indicators.
3. If spam is detected:
- Posts a predefined warning comment.
- Downvotes the rant.
4. Maintains logs and runs continuously to monitor new rants.
---
## Installation & Usage
1. **Setup**:
Clone the repository and ensure all dependencies are installed.
2. **Run the Bot**:
Execute the bot via the CLI:
```bash
python cli.py -u <username> -p <password>
## Notice
Some parts of the bot network are not published because they're very sensitive for abuse or specific made to work with my (mail-)server.
Not published parts are part of the Victoria project:
- Registering users.
- Account registration confirmation emails handler.
- Mass advertisement removal by indexing and scanning the network.