A modular, configurable system that scrapes content from Reddit, analyzes it using AI, and generates social media content optimized for different platforms.
This tool helps you discover trending topics and discussions on Reddit, extract valuable content ideas, and transform them into polished social media posts tailored for platforms like LinkedIn, Twitter, and Instagram.
- Reddit Content Scraping: Automatically collect posts from configurable subreddits with filtering by score and engagement.
- AI-Powered Analysis: Extract valuable content ideas and themes using advanced LLM models.
- Multi-Platform Content Generation: Create platform-optimized content for LinkedIn, Twitter, and Instagram.
- Multiple LLM Providers: Support for OpenAI, Anthropic, and Deepseek models with easy switching.
- Configurable Settings: Customize subreddits, content preferences, and LLM parameters.
- Command-Line Interface: Simple commands for running the entire pipeline or individual components.
-
Clone the repository:
git clone https://github.com/yourusername/reddit-content-agent.git cd reddit-content-agent -
Install dependencies:
pip install -r requirements.txt -
Set up environment variables in a
.envfile:# LLM API keys OPENAI_API_KEY=your_openai_key ANTHROPIC_API_KEY=your_anthropic_key DEEPSEEK_API_KEY=your_deepseek_key
To run the entire content generation pipeline (scrape, analyze, generate):
python main.py --run-pipeline
The components should be run in the following order:
- First, scrape Reddit content:
python main.py --scrape
- Then, analyze content to generate ideas:
python main.py --analyze
You can specify the target platform and content type during analysis:
python main.py --analyze --platform twitter --content-type thread
python main.py --analyze --platform linkedin --content-type article
python main.py --analyze --platform instagram --content-type post
- Finally, generate social media content:
python main.py --generate
Note: Each step depends on the previous step's data files. If you try to run the analyze step without first running the scrape step, you'll see a message: "No unanalyzed content found. Run scraping first." Similarly, if you try to run the generate step without first running the analyze step, you'll see: "No content ideas available. Run analysis first."
You can run the entire pipeline with a specific platform and content type:
python main.py --run-pipeline --platform twitter --content-type thread
python main.py --run-pipeline --platform linkedin --content-type article
python main.py --run-pipeline --platform instagram --content-type post
You can specify which LLM provider to use:
python main.py --provider openai --run-pipeline
python main.py --provider anthropic --run-pipeline
python main.py --provider deepseek --run-pipeline
Display statistics about collected content and generated ideas:
python main.py --stats
The system is highly configurable through settings in config/settings.py:
- LLM Providers: Configure models, temperature, and token limits for each provider
- Reddit Settings: Customize subreddits, time filters, and minimum engagement thresholds
- Content Preferences: Set default platforms, content types, tone, and hashtag preferences
reddit-content-agent/
├── .env # Environment variables and API keys
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── main.py # Entry point script
├── data/ # Data storage directory
│ ├── reddit_content.json # Scraped Reddit content
│ ├── content_ideas.json # Generated content ideas
│ └── generated_content.json # Final social media content
├── src/ # Source code
│ ├── reddit/ # Reddit interaction module
│ ├── analysis/ # Content analysis module
│ ├── generation/ # Content generation module
│ ├── llm/ # LLM provider integrations
│ └── utils/ # Utility functions
└── config/ # Configuration files
├── prompts/ # LLM prompt templates
└── settings.py # Default configuration settings
- Python 3.8+
- At least one LLM provider API key (OpenAI, Anthropic, or Deepseek)