Node 8.x is required
npm install --save overtrack.js
const ot = require('overtrack.js')
ot.player('eeveea')
.then((games) => console.log(games))
.catch(console.error)
I plan on writing better docs before release.
All methods return Promises
ot.player(key)
ot.sr(key[, options])
ot.clientVersion()
ot.lastMatch(key)
Returns: Simple game object.
ot.player('eeveea')
.then((games) => {
const game = games[0]
console.log('Simple game object:', game)
return game.detailed()
})
.then((game) => console.log('Detailed game object:', game))
.catch(console.error)
-
multipleAccounts:
Boolean
Default:false
[
{ name: String, sr: Number },
{...}
]
ot.sr('eeveea')
.then((sr) => console.log(sr))
.catch(console.error)
ot.sr('eeveea', { multipleAccounts: true })
.then((accounts) => {
const message = accounts
.map((x) => `${x.name}: ${x.sr}`)
.join('\n')
console.log(message)
})
.catch(console.error)
{
message: String,
number: String
}
ot.clientVersion()
.then((version) => console.log(version.message))
.catch(console.error)
Some fields may be null.
Returns: Simple game object.
ot.lastMatch('eeveea')
.then((game) => {
console.log('Last match:', game)
return game.detailed()
})
.then((game) => console.log('Detailed game object:', game))
.catch(console.error)
-
detailed
- Function, Returns: Promise<Detailed game object>
heroesPlayed
map
misc
result
season
sr
time
{
elims: Number,
damage: Number,
objectiveKills: Number,
healing: Number,
objectiveTime: Number,
deaths: Number,
tabHealth: Number,
timePlayed: Number,
specific: [
{ value: Number, name: String },
{...}
]
}
[
{ hero: String, percent: Number },
{...}
]
There are two different types of objects in the array kills, and resurrects.
[
{
left: {
hero: String,
player: String,
team: 'blue' || 'red'
},
resurrect: true,
right: {
hero: String,
player: String,
team: 'blue' || 'red'
},
timestamp: Number
},
{
assisters: [
String
],
killicon: {
hero: String,
ability: String
},
left: {
hero: String,
player: String,
team: 'blue' || 'red'
},
resurrect: false,
right: {
hero: String,
player: String,
team: 'blue' || 'red'
},
timestamp: Number
},
{...}
]
{
name: String,
type: String
}
customGame: Boolean || null,
key: String || null,
url: String|| null,
userId: Number || null,
user: String || null,
player: String || null,
json: String || null,
viewable: Boolean || null
{
blue: {
score: Number,
outcome: String
},
red: {
score: Number,
outcome: String
}
}
{
name: String,
number: Number,
offSeason: Boolean
}
{
diff: Number,
end: Number || null,
name: String,
start: Number || null
}
{
blue: {
sr: Number,
players: [
{ name: String, rank: String },
{...}
]
},
red: {
sr: Number,
players: [
{ name: String, rank: String },
{...}
]
}
}
{
start: Number,
end: Number || null,
length: Number
}
Pull requests are welcome.