wows-stats

command module
v0.0.0-...-eaf9504 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 12 Imported by: 0

README

wows-stats

Tool scrapping player data from World of Warships API and generated interesting graphs about server population with this data.

Build

Requirement

You need to have golang > 1.19 and make installed

Building

To build wows-stats, run:

make

Running

To run this tool, you need:

  • a WoWs API key
  • to be patient 😀

WoWs API key

To get a WoWs API key, please refer to the Wargaming Developer Documentation

Notice

Scrapping all the data is rather slow, be prepared to let the tool run for several hours, if not days.

Running the tool

Help:

$ ./wows-stats -help

Usage of ./wows-stats:
  -apikey string
    	Wargaming.net API key
  -debug
    	Enable debug mode
  -output string
    	Output file path (required)
  -server string
    	World of Warships server
  -skip-generation
    	Skip report generation
  -skip-scraping
    	Skip scraping data

Scrapping the data, and generating the report:

./wows-stats -apikey "xxxxx" -output index.html -server eu

From there, you can make the report available as a static html file (using nginx for example).

Or you can open it in your browser:

$ firefox index.html

Optional flags

You can skip the data collection or the report generation if needed:

# skip scrapping data (useful when tweaking graphs)
./wows-stats -apikey "xxxxx" -output index.html -server eu -skip-scraping

# skip report generation (useful when troubleshooting data collection issues)
./wows-stats -apikey "xxxxx" -output index.html -server eu -skip-generation

You can also enable more verbose logs if needed with the -debug flag:

./wows-stats -apikey "xxxxx" -output index.html -server eu -debug

Development

The project is separated in two main parts:

The raw data is stored in an SQLite DB, and its schema is defined here

If you want to access the DB directly (after data collection of course):

export WOWS_SERVER=eu
sqlite3 "$WOWS_SERVER-stats.db"

And then run whatever query you want:

SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
sqlite> SELECT AVG(random_win_rate) from players where random_battles > 7000;
© wows-stat. All rights reserved | © Wargaming.net. All rights reserved
This is application is a third-party tool under Wargaming Developers Program.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package pester provides additional resiliency over the standard http client methods by allowing you to control request rates, retries, and a backoff strategy.
Package pester provides additional resiliency over the standard http client methods by allowing you to control request rates, retries, and a backoff strategy.
wgn
wot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL