Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.17 KB

README.md

File metadata and controls

30 lines (26 loc) · 1.17 KB

🔁 Data Harvester for Server Stats WOT

How does it work:interrobang:

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

Run code!

  1. Create .env file that looks like this ✔️
    DB_LINK=<mongoDB connection string>
    APP_ID=<your WG API ID>
    
    WG API
  2. Install modules using npm ✔️
    npm install
  3. Run script! ✔️
    node index

Visit the project page!