GW2 KDR is a online tool for checking the kill/death of each world per hour.
Coded by Saber Lily.1960 aka acbetter@github.
Powered by Python, Vue.js and Day.js. Thanks to axios and Bulma.
View Online Demo: https://voidpin.com/tools/wvw-server-kdr/
You need install Python 3.7.x first. The script have some bugs in Python 3.6.x.
pip install requestsRunning a simple local HTTP server
# If Python version returned above is 3.X
python3 -m http.server
# On windows try "python" instead of "python3"
# If Python version returned above is 2.X
python -m SimpleHTTPServerYou need prepare a web server. I use Debian 10 and Python 3.7.3 here.
Use these commands to check.
which python3
python3 -V
which pip3
pip3 -V
pip3 install requestsI use crontab for run this script per hour.
In my Debian 10, cron is installed by default. However, if it is not installed on your machine, run the following few commands on the terminal with root privileges. scource
apt-get update
apt-get install cronFirst of all, we need download the script.
cd ~
git clone https://github.com/acbetter/gw2-kdr.gitThen type command crontab -e to set up crontab tasks and type command crontab -l to check.
1 * * * * cd /path/to/script && /usr/bin/python3 kdr.py
3 * * * * yes | cp /path/to/script/matches.json /path/to/nginx/dir/matches.json
3 * * * * yes | cp /path/to/script/worlds.json /path/to/nginx/dir/worlds.jsonFor me, I use root account (not recommand, it's unsafe) and candy server at path /var/www/api/ to deploy at https://gw2skr.com/kdr.html.
1 * * * * cd /root/gw2-kdr/ && /usr/bin/python3 kdr.py
3 * * * * yes | cp /root/gw2-kdr/matches.json /var/www/api/matches.json
3 * * * * yes | cp /root/gw2-kdr/worlds.json /var/www/api/worlds.jsonIf you need clean up.
rm -rf kdr.py
rm -rf matches.json worlds.jsonI use crontab for run this script per hour.
systemctl start cron
systemctl enable cron
systemctl status cronIf you use CentOS 7, here's a way to install Python 3.7.x
yum update -y
yum install wget
yum install gcc openssl-devel bzip2-devel libffi-devel
cd /usr/src
wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tgz
tar xzf Python-3.7.6.tgz
cd Python-3.7.6
./configure --enable-optimizations
make altinstall
rm /usr/src/Python-3.7.6.tgzAnd use these commands to check.
python3.7 -V
pip3.7 -V
pip3.7 install requestsI use crontab for run this script per hour.
yum install crontabs
systemctl start crond
systemctl enable crond
systemctl status crondThe rest is the same as Debian 10.
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.