{"id":29917637,"url":"https://github.com/willwillis/clash-royale-history","last_synced_at":"2026-05-18T10:33:25.780Z","repository":{"id":306525246,"uuid":"1026485943","full_name":"willwillis/clash-royale-history","owner":"willwillis","description":"gameplay history, most effective decks, and clan insights","archived":false,"fork":false,"pushed_at":"2025-10-02T05:14:56.000Z","size":33939,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T06:18:15.033Z","etag":null,"topics":["clash-royale","clash-royale-api","github-actions","github-pages","python"],"latest_commit_sha":null,"homepage":"https://willwillis.github.io/clash-royale-history/","language":"Python","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/willwillis.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-26T01:46:50.000Z","updated_at":"2025-10-02T05:14:59.000Z","dependencies_parsed_at":"2025-07-26T08:22:52.439Z","dependency_job_id":"a0a8be22-2e56-4ee8-b4a3-d5335b172f22","html_url":"https://github.com/willwillis/clash-royale-history","commit_stats":null,"previous_names":["willwillis/clash-royale-history"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/willwillis/clash-royale-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwillis%2Fclash-royale-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwillis%2Fclash-royale-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwillis%2Fclash-royale-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwillis%2Fclash-royale-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willwillis","download_url":"https://codeload.github.com/willwillis/clash-royale-history/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwillis%2Fclash-royale-history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016544,"owners_count":26085850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clash-royale","clash-royale-api","github-actions","github-pages","python"],"created_at":"2025-08-02T05:13:45.977Z","updated_at":"2025-10-13T18:04:42.995Z","avatar_url":"https://github.com/willwillis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clash Royale History\n\nAutomated Clash Royale battle analytics published to GitHub Pages, updated hourly via GitHub Actions.\n\n![Clash Royale Analytics Screenshot](cards/screenshot.png)\n\n## 🚀 Features\n\n- **Automated Data Collection**: Fetches battle data every hour\n- **Beautiful Analytics**: Responsive web interface with card images\n- **Deck Performance**: Win rates, trophy changes, usage statistics\n- **Battle History**: Recent battles with detailed results\n- **Clan Activity**: Member activity tracking and last seen times\n- **Mobile Optimized**: Responsive design for all devices\n\n## 📋 Setup Instructions\n\n### 1. Repository Setup\n\n1. **Fork or create a new repository** from this template\n2. **Enable GitHub Pages** in repository settings:\n   - Go to Settings → Pages\n   - Source: \"GitHub Actions\"\n\n### 2. Secrets Configuration\n\nAdd the following secrets in repository settings (Settings → Secrets and variables → Actions):\n\n- `CR_API_TOKEN`: Your Clash Royale API token from [developer.clashroyale.com](https://developer.clashroyale.com)\n- `CR_PLAYER_TAG`: Your player tag (e.g., `#YVJR0JLY`)\n\n### 3. Card Images (Optional)\n\nTo display card images:\n\n1. Create a `cards/` directory in the repository root\n2. Add subdirectories: `cards/normal_cards/` and `cards/evolution_cards/`\n3. Place card PNG files using the naming convention (see `html_generator.py` for mappings)\n\nExample structure:\n```\ncards/\n├── normal_cards/\n│   ├── Knight.png\n│   ├── Wizard.png\n│   └── ...\n└── evolution_cards/\n    ├── Knight.png\n    ├── Wizard.png\n    └── ...\n```\n\n### 4. First Run\n\nThe action will run automatically:\n- **Hourly**: `0 * * * *` (every hour at minute 0)\n- **Manual**: Use \"Run workflow\" button in Actions tab\n- **On push**: When you push to main branch\n\n## 🔄 How It Works\n\n1. **Data Collection**: GitHub Actions runs `analyzer.py` to fetch battle data from Clash Royale API\n2. **Database Update**: SQLite database (`clash_royale.db`) is updated and committed back to repo\n3. **HTML Generation**: `html_generator.py` creates responsive HTML report\n4. **GitHub Pages**: HTML is deployed to GitHub Pages automatically\n\n## 📁 Project Structure\n\n```\nclash-royale-history/\n├── .github/workflows/\n│   └── update-analytics.yml    # GitHub Actions workflow\n├── src/\n│   ├── analyzer.py            # Data collection and storage\n│   └── html_generator.py      # HTML report generation\n├── cards/                     # Card images (optional)\n├── pyproject.toml            # uv dependencies\n└── README.md\n```\n\n## 🛠️ Local Development\n\n```bash\n# Install dependencies\nuv sync\n\n# Set environment variables\nexport CR_API_TOKEN=\"your_token_here\"\nexport CR_PLAYER_TAG=\"#your_tag_here\"\n\n# Run data collection\ncd src\nuv run python analyzer.py\n\n# Generate HTML report\nuv run python html_generator.py\n```\n\n## 🔐 Security Notes\n\n- API tokens are stored as GitHub Secrets (encrypted)\n- Database contains no sensitive information\n- All data is publicly visible on GitHub Pages\n\n## 📊 Data Tracked\n\n- **Player Stats**: Trophies, level, clan info, win rate\n- **Battle Performance**: Results, trophy changes, crown counts\n- **Deck Analytics**: Win rates by deck composition\n- **Clan Activity**: Member donations, activity status\n- **Historical Trends**: Battle history over time\n\n## Caveats\nThe API only fetches your last 20ish battles, so metrics like win rate are calculated on the data since it's been collected, not your actual statistics\n\n## 🤝 Contributing\n\nFeel free to submit issues and pull requests to improve the analytics or add new features!\n\n## 📄 License\n\nMIT License - Feel free to use and modify as needed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwillis%2Fclash-royale-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillwillis%2Fclash-royale-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwillis%2Fclash-royale-history/lists"}