This repository contains a small Reddit bot powered by PRAW and HuggingFace Transformers. The bot can create posts, reply to relevant threads, and upvote content on the webdev subreddit. A lightweight Flask app provides a dashboard and runs the bot periodically using apscheduler.
Set the following variables in a .env file or your shell before running the bot:
REDDIT_CLIENT_ID– Reddit API client IDREDDIT_CLIENT_SECRET– Reddit API client secretREDDIT_USERNAME– Reddit account usernameREDDIT_PASSWORD– Reddit account passwordREDDIT_USER_AGENT– custom user agent string for the Reddit API
Use Python 3.8+ and install the dependencies with pip:
pip install -r requirements.txtStart the dashboard, which also schedules the bot to run every hour:
python app.pyThe app exposes a simple web page at http://127.0.0.1:8080/ that shows recent log messages and allows you to trigger the bot manually.
You can also run the bot without the web interface:
python bot.py- app.py – Flask server with a background scheduler. Shows the activity log and lets you run the bot on demand.
- bot.py – Core logic that uses GPT‑2 and Stable Diffusion to generate posts, comments, and images. Relevant posts and comments are identified with a zero‑shot classifier.
- test.py – Simple check to verify CUDA availability.
Generated images and text activity are logged to activity_log.txt.