This repository contains a Reddit Niche Bot that searches Reddit for specific keywords in posts and comments. It then sends email notifications and generates daily reports using Gemini's API. The bot is designed to run continuously, checking for new content on Reddit and sending alerts.
- Keyword Monitoring: Monitors Reddit for posts and comments containing specific keywords.
- Email Alerts: Sends email notifications when new relevant content is found.
- Daily Reports: Generates and sends a daily report summarizing the findings.
- Automated Scheduling: Automatically schedules daily reports.
- Docker installed on your system. You can download and install Docker from the official Docker website.
- A Reddit API account to generate your
client_id
,client_secret
, anduser_agent
. - Gmail credentials for sending email notifications.
- OpenAI API key for generating reports.
- Python packages and environment variables stored in a
.env
file.
Before deploying, ensure you have a .env
file in the project directory with the following variables:
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
REDDIT_USER_AGENT=your_reddit_user_agent
USER_EMAIL=your_email_address
USER_PASSWORD=your_email_password
USER_RECIPIENT_EMAIL=recipient_email_address
GEMINI_API_KEY=your_gemini_api_key
First, you need to build the Docker image using the Dockerfile
in the project directory. This command will create a Docker image with the tag reddit-niche-bot
.
docker build -t reddit-niche-bot .
This command does the following:
docker build
: Initiates the process of building a Docker image.-t reddit-niche-bot
: Tags the image with the namereddit-niche-bot
..
: Refers to the current directory, which contains theDockerfile
.
After the image is built, you can run the Docker container using the following command:
docker run -d --name reddit-bot reddit-niche-bot
Explanation:
docker run
: Starts a new Docker container.-d
: Runs the container in detached mode (in the background).--name reddit-bot
: Assigns the namereddit-bot
to the running container.reddit-niche-bot
: The name of the Docker image that was built in the previous step.
Once the container is running, the bot will start monitoring Reddit, sending email notifications, and generating daily reports.
Here are a few additional Docker commands you may find useful:
-
Check container logs:
docker logs reddit-bot
-
Stop the container:
docker stop reddit-bot
-
Remove the container:
docker rm reddit-bot
Searches Reddit comments and posts for the specified keywords and saves the results to a CSV file.
Checks the CSV file for new results, sends email notifications for relevant content, and tracks the content sent.
Uses OpenAI to generate a Markdown report from the collected data.
Generates and sends the daily report based on the collected data and scheduled tasks.