# CPU Performance per Dollar Analyzer A web application that compares CPUs from PB Tech New Zealand based on performance per dollar. It scrapes CPU listings from PB Tech, fetches benchmark scores from CPUBenchmark.net, and displays them sorted by the best value. ## Features - 🚀 **Real-time Progress Tracking** - Watch as the app scrapes data and processes results - 📊 **Performance per Dollar** - See which CPUs give you the best bang for your buck - 🏆 **Sorted Results** - Automatically ranked from best to worst value - 💰 **Live Pricing** - Gets current prices from PB Tech - 📈 **Benchmark Scores** - Fetches actual CPU performance data ## How It Works 1. **Scrapes PB Tech** - Uses Puppeteer to fetch CPU listings from PB Tech NZ 2. **Fetches Benchmarks** - Gets performance scores from CPUBenchmark.net 3. **Matches & Calculates** - Intelligently matches CPU names and calculates performance/dollar 4. **Displays Results** - Shows sorted results with medals for top 3 performers ## Installation ### Prerequisites - Node.js (v14 or higher) - npm ### Setup 1. Install dependencies: ```bash npm install ``` 2. Start the server: ```bash npm start ``` 3. Open your browser and navigate to: ``` http://localhost:3000 ``` ## Usage 1. Click the "🚀 Start Analysis" button 2. Watch the real-time progress as data is collected 3. View the results sorted by performance per dollar 4. Top 3 CPUs are marked with medals 🥇🥈🥉 ## Technical Stack - **Backend**: Node.js + Express - **Web Scraping**: Puppeteer (headless Chrome) - **Real-time Updates**: Server-Sent Events (SSE) - **Frontend**: Vanilla HTML/CSS/JavaScript ## Project Structure ``` cpubro/ ├── server.js # Express server with SSE ├── scrapers/ │ ├── pbtech.js # PB Tech scraper │ └── cpubenchmark.js # CPU Benchmark scraper ├── public/ │ └── index.html # Frontend UI ├── package.json └── README.md ``` ## Performance Calculation ``` Performance per Dollar = CPU Benchmark Score / Price (NZD) ``` Higher values indicate better value for money. ## Notes - First run may take 30-60 seconds to fetch all data - Requires internet connection to access PB Tech and CPUBenchmark.net - CPU name matching uses fuzzy logic to handle variations - Only shows CPUs that have matching benchmark data ## Troubleshooting **Problem**: No CPUs found - Check internet connection - PB Tech website structure may have changed - Try running again (temporary network issues) **Problem**: Slow performance - Benchmark database has thousands of CPUs - First load may be slower - Subsequent runs should be faster ## License MIT