Tracks your WGMods statistics with Playwright and posts changes to Discord webhooks.
The reusable code is kept in the wgmods_tracker/ package folder. tracker.py is only a thin runner.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install chromium
cp config.example.json config.jsonOn Windows:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
playwright install chromium
copy config.example.json config.jsonpython tracker.py snapshot
python tracker.py watch
python tracker.py test-webhooksconfig.json has two webhook URLs:
"discord": {
"stats_webhook_url": "",
"announcements_webhook_url": ""
}The stats webhook receives download, vote, visible rating, internal rating, and version changes. The changed value itself is linked to the WGMods page.
The announcements webhook receives new mod announcements and changelog/update announcements.
Update/changelog:
# 🔄 Crosshair Ballistics Info `1.1`
Added the option to customize the colour of the overlay in the preferences.xml file. (Section: ballisticsCrosshairOverlay)
[Download](https://wgmods.net/7681/)
<@&1472909774919307286>New mod:
# :new: Crosshair Ballistics Info `1.0`
Shows distance, dynamic damage, and dynamic penetration at your crosshair.
Especially useful for Deep Rifled Guns.
[Download](https://wgmods.net/7681/)
@Update NotificationsFor new mods, the bot cleans the WGMods description and strips common support/Discord/Patreon lines.
Create /etc/systemd/system/wgmods-tracker.service:
[Unit]
Description=WGMods Tracker Bot
After=network-online.target
Wants=network-online.target
[Service]
WorkingDirectory=/home/pi/wgmods_tracker_bot
ExecStart=/home/pi/wgmods_tracker_bot/.venv/bin/python tracker.py watch
Restart=always
RestartSec=30
User=pi
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable wgmods-tracker
sudo systemctl start wgmods-tracker
sudo systemctl status wgmods-trackerThe first real snapshot intentionally does not announce every existing mod, because otherwise a fresh Raspberry Pi install could spam your announcement channel with all old mods.
To test the exact Discord announcement formatting without touching WGMods or the database, run:
python tracker.py test-announcementsThis sends one sample update announcement and one sample new-mod announcement to discord.announcements_webhook_url.
To test a real new-mod announcement using live WGMods data during the first bootstrap, run for example:
python tracker.py snapshot --announce-existing --max-announcements 1That posts only the first existing mod as a new-mod announcement. Remove --max-announcements 1 only if you intentionally want to announce every existing mod found during the snapshot.
A reusable Tkinter desktop application for exploring the SQLite database generated by the WGMods tracker.
- Open any compatible
wgmods_stats.sqlitefile. - Search and multi-select mods.
- Quick-select the top 5 or top 10 mods by growth.
- Plot downloads, votes, public rating, and internal rating.
- Choose raw snapshots, hourly, daily, or weekly aggregation.
- Compare:
- absolute values
- cumulative growth
- period-by-period change
- percentage growth
- indexed growth where every mod starts at 100
- Line, step, area, and bar plots.
- Optional smoothing, markers, legend, and compressed/log scale.
- Built-in Matplotlib toolbar for zoom, pan, reset, and image export.
- Summary table and CSV export.
- Zurich timezone by default, editable in the interface.
py -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
python viewer.pyYou can also pass a database path:
python viewer.py "data\wgmods_stats.sqlite"Tkinter is usually installed through apt:
sudo apt update
sudo apt install -y python3-tk python3-venvThen run:
chmod +x run_linux.sh
./run_linux.shA desktop environment or X forwarding is required because this is a GUI program.
To compare large and small mods fairly:
- Select
Downloads - Set aggregation to
Daily - Use
Cumulative growth,Percentage growth, orIndexed growth (100)
To see daily download gains:
- Select
Downloads - Set aggregation to
Daily - Use
Period change - Choose
BarorLine
To inspect vote direction and ranking effects:
- Select
Votes,Public rating, andInternal rating - Use
Raw snapshotsorHourly - Use
Absolute value
The date fields use separate year, month, and day spinboxes, so you can move across months and years directly with the arrow buttons or keyboard.