0.0.1 • Published 10 years ago

entgaming-mod-stats v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 years ago

Overview

Web crawler to retrieve general game data from entgaming.net (custom stats).

You can:

  • Iterate through each game of a mod.
  • Get number of games per day.
  • Average number of games.

Usage

var Crawler = require('entgaming-mod-stats')

// Create an instance for a mod, for example: nwu
var myMod = new Crawler('nwu')

// Get Average games:
myMod.averageGames(function(err, average){
	console.log("Average games:", average)	
})

// Get games by day
myMod.gamesByDay(function(err, byDay){
	console.log(byDay)
})

// Iterate over games
myMod.each(function(game){
	console.log(game)
}, function onFinish(){
	console.log('Finished!')
})

It may take a while to obtain the information depending on the number of games available.

You could use .each function to store data in a database or file.

Available mods codes

Script works with mods available under "customstats" section

  • Legion TD Mega: legionmega
  • Battleships: battleships
  • Castle Fight: castlefight
  • Civilization Wars: civwars
  • Hero Line Wars: herolinewars
  • Hero Wars Icelands: herowarsice
  • Island Defense: islanddefense
  • Legion TD Mega: legionmega
  • Naruto Wars Unlimited: nwu
  • Risk Devolution: riskdevo
  • Tree Tag: treetag
  • Enfo's FFB: enfo
  • Castle Fight 1v1: cfone
  • Legion TD Mega 1v1: legionmegaone
  • Legion TD Mega 2v2: legionmegatwo
  • LTD x10: ltdx10
  • LIHL (ENT LTD IHL): lihl
  • NWU IH: nwuih
  • IDIH (ENT ID IHL): idih

Game data

Data is gathered from games section of a mod. For example: Battleships

When calling .each function, each game object has the following attributes:

  • map: String, Map name
  • duration: String, Duration (raw from HTML)
  • timedate: String, Game date (raw from HTML)
  • date: Date, game date
  • datestr: String, game date formatted dd/mm/yyyy
  • gameId: String, Game id.

Example:

{ 
	map: 'Legion TD Mega 3.5 (B4).w3x',
	duration: '14m24s',
	timedate: '28/11/2015, 11:13',
	date: Sat Nov 28 2015 11:13:00 GMT-0300 (CLT),
	datestr: '28/11/2015',
	gameId: '6848988' 
}