🔁 Data Harvester for Server Stats WOT
There are 3 api endpoints hosted on repl, making a GET request will trigger this actions
- Harvester - fetching data from WG API and saving it in mongoDB database
- Daily Stats - fetching data from last 24 hours and returning average players online during this time period
- Delete - deleting unnecessary data from mongoDB (only every-hour stats) older than 2 days
I'm using https://cron-job.org/ for setting up the requests; they are set up like this
- Harvester - every hour
- Daily Stats - every 24 hours at 1:00 AM UTC+1
- Delete - mondays and fridays at 2:00 AM UTC+1
- Create
.env
file that looks like this ✔️WG APIDB_LINK=<mongoDB connection string> APP_ID=<your WG API ID>
- Install modules using npm ✔️
npm install
- Run script! ✔️
node index