{"id":28493832,"url":"https://github.com/cmod/amazon_ranking","last_synced_at":"2026-01-31T15:34:40.625Z","repository":{"id":296753960,"uuid":"994371206","full_name":"cmod/amazon_ranking","owner":"cmod","description":"Track your Amazon Ranking over time","archived":false,"fork":false,"pushed_at":"2025-08-08T05:46:11.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-12T23:35:16.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-01T19:47:02.000Z","updated_at":"2025-08-08T05:46:15.000Z","dependencies_parsed_at":"2025-06-03T06:49:43.445Z","dependency_job_id":null,"html_url":"https://github.com/cmod/amazon_ranking","commit_stats":null,"previous_names":["cmod/amazon_ranking"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cmod/amazon_ranking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmod%2Famazon_ranking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmod%2Famazon_ranking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmod%2Famazon_ranking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmod%2Famazon_ranking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmod","download_url":"https://codeload.github.com/cmod/amazon_ranking/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmod%2Famazon_ranking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T09:37:11.195Z","updated_at":"2026-01-31T15:34:40.620Z","avatar_url":"https://github.com/cmod.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon Book Ranking Tracker\n\nTrack your Amazon book sales rankings and review metrics over time with interactive visualizations.\n\n## Features\n\n- **Multi-Category Tracking**: Captures overall Books ranking plus all sub-category rankings\n- **Review Count Monitoring**: Tracks review growth over time\n- **Interactive Dashboard**: Individual charts for each category (colorblind-friendly)\n- **Multiple Data Formats**: JSON for dashboard, CSV for analysis\n- **Template-Based**: Easy to customize dashboard appearance\n\n## Quick Start\n\n1. **Install Dependencies**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. **Configure Your Book**\n   - Edit `amazon.py` and update the `URL` variable with your book's Amazon page\n   - Currently set to: `https://www.amazon.com/dp/0593732545`\n\n3. **Run the Tracker**\n   ```bash\n   # Default - creates index.html in current directory\n   python amazon.py\n   \n   # Or specify custom output directory\n   python amazon.py --output-dir /path/to/web/root\n   python amazon.py -o ./public\n   ```\n\n4. **View Dashboard**\n   - Open `index.html` in your browser\n   - Data is stored in the `data/` directory\n\n## File Structure\n\n```\namazon_ranking/\n├── amazon.py                    # Main scraper script\n├── dashboard_template.html      # HTML template for dashboard\n├── index.html                   # Generated interactive dashboard\n├── requirements.txt             # Python dependencies\n├── data/                        # Data storage directory\n│   ├── amazon_history.json     # JSON data for dashboard\n│   └── amazon_detailed_history.csv  # Detailed CSV format\n└── CLAUDE.md                   # Development documentation\n```\n\n## Server Deployment\n\n### Option 1: Simple Python Server\n```bash\n# Install dependencies\npip install -r requirements.txt\n\n# Run scraper (creates data/ directory automatically)\npython amazon.py\n\n# Serve dashboard (optional)\npython -m http.server 8000\n# Access at http://localhost:8000\n```\n\n### Option 2: Cron Job for Regular Updates\n\n**Option A: Using system Python (after pip install -r requirements.txt)**\n```bash\n# Add to crontab for every 6 hours\n0 */6 * * * cd /path/to/amazon_ranking \u0026\u0026 /usr/bin/python3 amazon.py\n\n# Or with custom output directory (e.g., web server root)\n0 */6 * * * cd /path/to/amazon_ranking \u0026\u0026 /usr/bin/python3 amazon.py --output-dir /var/www/html\n```\n\n**Option B: Using virtual environment**\n```bash\n# Add to crontab - activate venv first\n0 */6 * * * cd /path/to/amazon_ranking \u0026\u0026 source venv/bin/activate \u0026\u0026 python amazon.py -o /var/www/html\n\n# Or use direct path to venv python\n0 */6 * * * cd /path/to/amazon_ranking \u0026\u0026 ./venv/bin/python amazon.py --output-dir /var/www/html\n```\n\n**To edit crontab:**\n```bash\ncrontab -e\n```\n\n### Option 3: Web Server (nginx/Apache)\n- Place files in web root directory\n- Set up cron job to run `python amazon.py` regularly\n- Serve `index.html` as static file\n\n## Data Outputs\n\n- **`data/amazon_history.json`**: Structured data for dashboard\n- **`index.html`**: Interactive dashboard with Chart.js visualizations\n- **`data/amazon_detailed_history.csv`**: CSV format for spreadsheet analysis\n\n## Customization\n\n### Dashboard Appearance\nEdit `dashboard_template.html` to customize:\n- Colors and styling (CSS)\n- Chart configurations\n- Layout and design\n\n### Target Book\nUpdate the `URL` constant in `amazon.py`:\n```python\nURL = \"https://www.amazon.com/dp/YOUR_BOOK_ID\"\n```\n\n## Command Line Options\n\n```bash\n# Show help\npython amazon.py --help\n\n# Specify output directory for index.html\npython amazon.py --output-dir /path/to/directory\npython amazon.py -o ./public\n\n# Examples:\npython amazon.py -o /var/www/html        # Web server root\npython amazon.py -o ~/Desktop/dashboard  # Desktop folder\npython amazon.py -o ./build              # Build directory\n```\n\n## Dependencies\n\n- **requests**: HTTP requests to Amazon\n- **beautifulsoup4**: HTML parsing and data extraction\n- **Chart.js**: Interactive charts (loaded via CDN)\n\n## Troubleshooting\n\n- **No rankings found**: Amazon may have changed their HTML structure\n- **Bot detection**: The script uses browser-like headers to avoid detection\n- **Missing data**: Ensure the Amazon URL is correct and accessible\n\n## Current Example Data\n\nThe tracker currently monitors these categories:\n- Overall Books ranking (e.g., #17031 in Books)\n- General Japan Travel Guides (e.g., #4)\n- Traveler \u0026 Explorer Biographies (e.g., #63)\n- Memoirs (e.g., #315)\n- Review count tracking (e.g., 37 reviews)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmod%2Famazon_ranking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmod%2Famazon_ranking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmod%2Famazon_ranking/lists"}