How summersonnn/reddit_analyzer works
Reddit Thread Analyzer is a Streamlit app that turns a Reddit thread URL and user-selected summary options into summaries and ranked comments. The main flow fetches and structures the thread, optionally enriches the post with image and external-link context, generates summaries, ranks comments, and displays results. Cache helpers reuse or persist analyses locally or in S3. The graph reflects the sampled orchestration and helpers; some frontend and scraping details were omitted, so uncertain internal wiring is left out.
Main entry points: home.py Home and orchestration · analyze_main.py Analysis orchestration · llm_interact.py LLM client · cache_helpers.py Cache lookup and updates
Components 18
User interface
- Home and orchestration
frontend/home.py - Analysis results
frontend/analysis.py - Summary options
frontend/home.py
Thread processing
- Thread retrieval
analyze_main.py - Reddit fetch and parsing
scrape_functions.py
Analysis and enrichment
- Analysis orchestration
analyze_main.py - Media enrichment
analyze_main.py - External-link summaries
try_html_summary.py - Comment ranking
thread_analysis_functions.py - LLM client
llm_interact.py - Prompt loading
config.py - Prompt definitions
prompts.yaml
Analysis cache
- Cache lookup and updates
frontend/cache_helpers.py - CSV analysis cache
analyses.csv
Other components
- App user
- LLM and vision API
- S3 cache
Connections 21
- App user → Home and orchestration: opens app
- Home and orchestration → Summary options: collects options
- Home and orchestration → Cache lookup and updates: checks cache
- Home and orchestration → Thread retrieval: requests thread
- Thread retrieval → Reddit fetch and parsing: fetches and parses
- Reddit fetch and parsing → Reddit: requests JSON
- Home and orchestration → Analysis orchestration: starts analysis
- Analysis orchestration → Reddit fetch and parsing: fetches thread data
- Analysis orchestration → Prompt loading: loads prompts
- Prompt loading → Prompt definitions: reads
- Analysis orchestration → Media enrichment: enriches post
- Media enrichment → LLM client: analyzes images
- Media enrichment → External-link summaries: summarizes links
- External-link summaries → LLM client: requests summary
- Analysis orchestration → LLM client: generates summaries
- LLM client → LLM and vision API: sends completions
- Analysis orchestration → Comment ranking: ranks comments
- Home and orchestration → Analysis results: displays results
- Cache lookup and updates → CSV analysis cache: reads and writes
- Cache lookup and updates → S3 cache: reads and writes
- Home and orchestration → S3 cache: reads cache