Skip to content

Latest commit

 

History

History
112 lines (79 loc) · 2.55 KB

File metadata and controls

112 lines (79 loc) · 2.55 KB

Tech Trends Reddit Bot

A Reddit bot that detects developer and market interest in programming technologies based on GitHub activity, Stack Overflow mentions, job postings, and Google Trends, then replies with a summary and visual graph. Ideal for spotting tech trends like the rise of Rust, Python, or TypeScript.


Features

  • Aggregates data from:
  • GitHub repositories
  • Stack Overflow tags
  • Job posting frequency
  • Google Trends (12-month smoothed graph)
  • Replies to Reddit comments with a keyword trigger (e.g. !devtrends rust)
  • Uploads trend graph to ImgBB and embeds it in the reply
  • Modularized, easy-to-extend Python codebase

Setup

1. Clone the repository

git clone https://github.com/umer901/RedditDevBot

2. Create and activate a virtual environment (optional but recommended)

python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

3. Install dependencies

pip install -r requirements.txt

4. Create a .env file

# Reddit API
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password
REDDIT_USER_AGENT=TechTrendBot by u/your_reddit_username

# Imgbb API
IMGBB_API_KEY=your_imgbb_api_key

# Redis cache (optional values shown with their defaults)
REDIS_URL=redis://localhost:6379/0
CACHE_TTL_SECONDS=3600
CACHE_ENABLED=true

Redis is used to cache a completed analysis for one hour. Cache failures are treated as misses, so the bot continues to work if Redis is temporarily unavailable. Set CACHE_ENABLED=false to run without caching.

Start a local Redis instance with Docker before running the bot:

docker compose up -d redis

🚀 Running the Bot

Make sure your .env file is set up, then run:

python reddit.py

The bot will listen for Reddit comments that start with:

!devtrends <technology>

Example:

!devtrends rust

Here is a sample response (excluding the graph)

Sample Response


Project Structure

├── reddit.py             # Main bot script
├── main.py               # Runs secondary functions
├── github.py             # GitHub data fetcher
├── stackoverflow.py      # Stack Overflow tag scraper
├── jobs.py               # Job postings search
├── trends.py             # Google Trends + graphing
├── utils.py              # Image upload and helpers
├── requirements.txt
└── README.md