Package: crtools
NOTE - this project is no longer maintained. If you are a crtools user, and wish to take over maintaintainership of this project, please contact me.crtools - Clash Royale Clan Dashboard generatorThis is a tool for creating a dashboard for clan participation in ClashRoyale.
Seehttps://developer.clashroyale.comto sign up for a developer account and
create an API key to use with this.For an example dashboard created for the clan Agrassar (#JY8YVV), see:https://agrassar.com/This tool is a static site generator – it generates static HTML, JavaScript,
and CSS used to render the dashboard. If you wish to use this, you should set
it up to run once per hour on your web server.InstallationThis requires Python 3 and pip on your machine. To install, usepip3 install crtoolsIf you have an older version installed, to upgrade to the latest version, run:pip3 install -U crtoolsSyntaxUsage:crtools [-h] [--locale LOCALE] [--config CONFIG-FILE] [--api_key KEY]
        [--clan TAG] [--out PATH] [--favicon PATH] [--clan_logo PATH]
        [--description PATH] [--canonical_url URL] [--debug]
        [--version]optional arguments:-h,--helpshow this help message and exit--localeLOCALELocale if language other than English is desired (seeOther languages/locales).--configFILEconfiguration file for this app.--api_keyKEYAPI key for developer.clashroyale.com--clanCLANClan ID from Clash Royale. If it starts with a ‘#’, clan ID must be quoted.--outPATHOutput path for HTML.--faviconPATHSource path for favicon.ico. If provided, we will copy to the output directory.--clan_logoPATHSource path for clan logo PNG. Recommended at least 64x64 pizels. If provided, we will copy to the output directory.--descriptionPATHSource path snippet of HTML to replace the clan description. Should not be a complete HTML document. Sample here:https://github.com/AaronTraas/crtools-agrassar-assets/blob/master/description.htmlIf provided, we will copy to the output directory.--canonical_urlURLCanonical URL for this site. Used for setting the rel=canonical link in the web site, as well as generating the robots.txt and sitemap.xml--debugTurns on debug mode--versionList the version of crtools.Optional config filecrtools looks for a config file in your home directory called .crtoolsThis is an INI file. As of current version, there’s only one possible
parameter: api_key. The file should look like:[API]# API key provided for your account at https://developer.clashroyale.com# Note that the key is limited to a specific list of public IP addressesapi_key=<YOUR-API-KEY># Your clan tagclan_id=#JY8YVV# Proxy URL -- URL for proxy server, if needed#proxy=https://my-proxy.com# Proxy headers -- custom headers for proxy if needed#proxy_headers=headers[Paths]# your output path. Where you want the static website to live.out=/var/www/html# Path to the logo artwork for clan. Must be PNG. Recommended at# least 64x64 pixels.clan_logo=~/myclan/logo.png# Path to the favicon file you want to use for thisfavicon=~/myclan/favicon.ico# Path to a file that contains arbitrary HTML for the site.description_html=~/myclan/body.html[www]# Canonical URL for this site. Used for setting the rel=canonical# link in the web site, as well as generating the robots.txt# and sitemap.xmlcanonical_url=https://yourclan.com/For more details, seesamples/crtools.iniOptional blacklist and vacation management using Google SheetsYou can optionally use a Google Sheets log to keep track of demerits
and vacations. If you want that info to be integrated with crtools, you
need to copy thecrtools member log templateto your Google Docs account and use that. Fill in with info about your
clan. Be sure not to re-name any of the tabs, or add/remove any columns.You will also need to sign up for aGoogle Cloud API key.Then you will have to go to theGoogle Developer API library page, and enable the Google Sheets library for your account.You will then need to go the theGoogle credential management page, edit the API key you created, giving it access to the Sheets API.Once you have created a key that you can use for this purpose, find the sheet ID from your spreadsheet URL, add
the following to your config file:[google_docs]api_key=<YOUR-API-KEY>sheet_id=<YOUR-SHEET-ID>Using the ClashRoyale Official Fan KitThe design of this site is optionally enhanced by the fan kit provided by
Supercell here. To enable automated downloading of the fan kit, add:use_fankit=TrueTo the[Paths]section of your config file.NOTE: This requires about 5GB free in your temp forlder on the machine that
crtools runs on. It will take 10-15 minutes to download and extract, but only
the first time you run with the fankit enabled.If you have problems, you can manually install the fan kit. SeeFan Kit Manual Install InstructionsOther languages/localesCrtools currently supports the following languages:localelanguagecnChinesedeGermanenEnglish (default)frFrenchitItalianptPortugeseruRussianIf you’d like to use a language other than English, add the following switch
on the command line:--locale=frThe above example is French. Use the locale code listed aboveIf you wish for crtools to be available in another languages, reach out to
me. I’m unable to do the translation myself (I speak only English), but I can
help you provide a translation for this.Suggested usage on a Linux web serverThis tool is a static site generator – it generates static HTML, JavaScript,
and CSS used to render the dashboard. If you wish to use this, you should set
it up to run once per hour on your web server usingcronor similar.
Below is an example setup on Linux.Assuming root is going to be running the script:Install this application via pipInstall nginx or apacheFind your document root (e.g.,/var/www/html)Create/root/.crtoolsfile as specified above, and add your
API key (fromhttps://developer.clashroyale.com), output path (the
document root), and clan tagCreate the following entry in your crontab:0 * * * * crtoolsDevelopment linksThis project uses SonarQube for static analysis. The results of analysis
are atSonarCloud.
The code quality and test coverage are a work in progress.ContributorsAll of the non-code contributors are listed inCONTRIBUTORS.rstImage rightsAll images except the flags included in this repository were created by the
team, and are included in the GPL license. The SVGs were all created in
Inkscape.The flags included are fromhttp://www.famfamfam.com/lab/icons/flags/, which
as of 5/27/2019 stated it required no attribution or license. We are
interpreting this to mean these are available in the public domain.It was important to us to make sure the entirety of this application is
open source, and not subject to takedown request. We will not ever
extract assets from the game or from any other web properties.Optionally, crtools can download the official Clash Royale fan kit and use
some of the content contained. This is not the default behavior, and no
works copywritten by Supercell are contained within this code.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:https://supercell.com/en/fan-content-policy/