A real-time sentiment analysis tool that tracks public opinion about any topic by collecting and analyzing posts from Reddit and Hacker News.
Originally created to monitor sentiment towards Claude (Code/AI) over time, Opinometer evolved into a general-purpose tool for tracking how online communities feel about any product, technology, or topic.
Opinometer provides instant insights into how communities feel about specific topics by:
- Collecting posts from Reddit and Hacker News in parallel
- Analyzing sentiment separately for titles, post content, and linked articles
- Presenting results in a beautiful, color-coded terminal interface
- Tracking version mentions (e.g., "Claude 4", "Sonnet 3.5") for product analysis
- Exporting data to JSON and CSV for further analysis
- Multi-source data collection: Parallel fetching from Reddit and Hacker News APIs
- Three-level sentiment analysis:
- Title sentiment
- Post body sentiment (Reddit self-posts)
- Linked content sentiment (optional with
-cflag)
- Z-score normalization: Fair comparison of Reddit and HackerNews posts despite different score scales
- Version extraction: Automatically detects and categorizes product versions
- Platform-specific display: Color-coded sources (Reddit: blue, HackerNews: orange)
- Smart URL handling: Shows both discussion URLs and external links with longer permalink formats
- Smart date formatting: Color-coded relative timestamps (today, last week, 3 months, etc.)
- Beautiful console output: Rich terminal UI with colored tables and progress indicators
- Robust error handling: Detects API rate limits and access issues with helpful messages
- No API keys required: Uses public APIs for both platforms
- Data export: Save results to JSON and CSV formats
- Async/parallel processing: Fast data collection and content fetching
- Platform abstraction: Clean class-based architecture for easy extension
- Type safety: Modern Python 3.13+ with type hints
- PostgreSQL integration: Optional database storage with SQLModel (ready)
- Python 3.13+
- uv package manager
# Clone the repository git clone https://github.com/yourusername/opinometer.git cd opinometer # Install dependencies uv sync
# Analyze sentiment for "Claude Code" uv run src/main.py # Custom query uv run src/main.py --query "ChatGPT" # Show all posts (not just top 10) uv run src/main.py --all-posts # Sort by date instead of sentiment uv run src/main.py --sort-by-date # Analyze linked content too (slower) uv run src/main.py --analyze-content # Limit number of posts collected uv run src/main.py --limit 100
π Sentiment Analysis Summary for 'Claude Code'
Total posts analyzed 24
Average sentiment +0.119
Positive 7 (29.2%)
Neutral 13 (54.2%)
Negative 4 (16.7%)
βββββββββββββββββ³ββββββββ³βββββββββββββ³ββββββββββββββ³βββββββββ³ββββββββββββββββββββββββββββββββ
β Source β Score β Date β Version β Sentmt β Title / Post Link / Content β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β Reddit β 2.1k β 2025εΉ΄09ζ29ζ₯ β Claude 3.7 β +0.985 β Just tried Claude Code... β
β r/Anthropic β β today β β +0.891 β https://reddit.com/r/... β
β Reddit β 1.5k β 2025εΉ΄09ζ25ζ₯ β Claude Code β +0.973 β The Claude Code is amazing β
β r/ClaudeAI β β last week β β N/A β https://reddit.com/r/... β
β HackerNews β 892 β 2025εΉ΄08ζ19ζ₯ β Claude Code β -0.920 β Claude Code broke my build β
β β β 3 months β β -0.847 β https://news.ycombinator.com β
βββββββββββββββββ΄ββββββββ΄βββββββββββββ΄ββββββββββββββ΄βββββββββ΄βββββββββββββββββββββββββββββββ
opinometer/
βββ src/
β βββ platforms/ # Platform-specific data collectors
β β βββ base.py # Abstract base class
β β βββ reddit.py # Reddit API integration
β β βββ hackernews.py # Hacker News API integration
β βββ database/ # PostgreSQL/SQLModel integration
β β βββ models.py # Database models
β β βββ config.py # Database configuration
β β βββ cli.py # Database management CLI
β βββ analysis.py # Sentiment analysis & word frequency
β βββ display.py # Table formatting & rendering
β βββ file_io.py # File I/O & content fetching
β βββ main.py # CLI application
β βββ model_extractor.py # Generic model version detection
β βββ version_extractor.py # Claude-specific version detection
βββ tests/ # Test suite
βββ alembic/ # Database migrations
βββ pyproject.toml # Project dependencies
βββ results/ # Analysis output (auto-created)
- Strategy Pattern: Platform-specific collectors inherit from
BasePlatform - Async/Await: Parallel HTTP requests for fast data collection
- Type Safety: Type hints with TypedDict for data structures
- Dependency Injection: Console and analyzer passed to platform classes
Opinometer includes PostgreSQL integration for persistent storage:
# Start PostgreSQL (Docker) docker-compose up -d # Initialize database uv run python scripts/setup_database.py # Check status uv run python -m src.database.cli status
See DATABASE_SETUP.md for details.
# Run all tests pytest # With coverage pytest --cov=src tests/
# Format code ruff format src/ tests/ # Lint ruff check src/ tests/ # Type check mypy src/ tests/
See CONTRIBUTING.md for contribution guidelines.
| Component | Technology | Purpose |
|---|---|---|
| Language | Python 3.13+ | Modern type hints, performance |
| Package Manager | uv | Fast, reliable dependency management |
| CLI Framework | Typer | Type-safe command-line interface |
| HTTP Client | httpx | Async HTTP requests |
| Sentiment Analysis | VADER | Lexicon-based sentiment scoring |
| Terminal UI | Rich | Beautiful console output |
| Database | PostgreSQL + SQLModel | Optional persistent storage |
| Testing | pytest | Unit and integration tests |
| Linting | Ruff | Fast Python linter and formatter |
| Type Checking | mypy | Static type analysis |
- Monitor sentiment about product launches
- Track version-specific feedback
- Identify pain points in real-time
- Study opinion dynamics in online communities
- Analyze sentiment patterns over time
- Compare platform-specific sentiment differences
- Track developer tool adoption
- Monitor community reactions to updates
- Gather user feedback at scale
- Phase 1: Multi-source collection with VADER sentiment β
- Phase 2: Model version extraction & comment analysis β
- Phase 3: Web frontend (HTMX + Chart.js)
- Phase 4: Database integration & background refinement
- Phase 5: Advanced ML features
See ROADMAP.md for details.
MIT License - see LICENSE for details.
- VADER sentiment analysis by C.J. Hutto
- Reddit and Hacker News for public APIs
- Built with modern Python tooling (uv, Ruff, Rich)
Note: This tool is designed for public sentiment research and analysis. Please respect platform rate limits and terms of service.