Displays clan data in a graphical, easy to read form.
See http://nightwarriors.crazy.technology for a sample set up.
Replace the clantag via the $clantag
variable. Replace $token
with a valid token obtained from https://developer.clashofclans.com/
Runs update.php to get a specific clan's info.
- Set up a cron job to schedule the api calls periodically
- Enjoy
This script saves a file data/clan-info.json, containing 3 items:
- Timestamp when script was run
- Clan info
- Full profile for each player in the clan
Note: This will result in ~50 API calls each time this script is run, which is why I do not call it directly on page load. (1) It's slow. (2) Your API calls may be blocked if called too frequently.
This site uses Chart.js charts, bootstrap, and PHP.
Feel free to open a new issue with ideas and suggestions.
Clash on!
Disclaimer: "This content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it. For more information see Supercell's Fan Content Policy: www.supercell.com/fan-content-policy."
Like my work? Buy me a beer: paypal.me/edwinchuatech
- Replaced curl with file_get_contents (mostly preference, but there are some php installations that don't have curl)
- Removed the retry loop
- Split config in separate file
- Removed the API key from git (saw that its a base64 encoded JSON Web Token, best practice is to not include credentials publicly)
Thanks for this update @Jimbolino
- Upgraded from Bootstrap v4.0.0 beta to Bootstrap v 4.0.0
- Layout enhancements with grid (CSS) - Breaks compatibility with Internet Explorer
- Added minimal AngularJS (from CDN) to more easily update clan info DOM
- Refactored code to utilize AngularJS instead of JQuery for updating elements on page
- Charts now trim long player names
- Current Donations chart now show Donations & Donations Received
- Added ability to click charts to navigate to user profile
- Properly excluded inactive players from Current Donations chart
- Fixed font "text-rendering: geometricPrecision;" to properly display the digit '2'