-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
29 lines (28 loc) · 1.17 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { Smite, Paladins } = require('./lib')
const axios = require('axios').default
const fs = require('fs')
;(async () => {
const credentials = {
devId: process.env.DEVID,
authKey: process.env.AUTHKEY
}
const apis = new Smite(credentials)
// console.log((await apis.getGods()).data[113].Name)
// console.log((await apis.getGods()).data[113].Name)
const request = await apis.getPlayer('TheDavidm12')
const id = request.data[0].Id
// const matchId = (await apis.getMatchIdsByQueue(474, 20210514, '15,50')).data[0].Match
// const data = await apis.getTopMatches()
const data = await apis.getItems()
fs.writeFile('request.json', JSON.stringify(data, undefined, 2), (err) => {
if (err) throw err
})
})()
// const updatedAt = 1620447642094
// const now = Date.now()
// const millisTranscurred = Math.abs(updatedAt - now)
// const secondsTranscurred = (millisTranscurred / 1000).toFixed()
// const minutesTranscurred =
// secondsTranscurred % 60 === 0 ? Math.ceil(secondsTranscurred / 60 + 1) : Math.ceil(secondsTranscurred / 60)
// const minutesAndSecondsTranscurred = `${minutesTranscurred}m ${secondsTranscurred % 60}s`
// console.log(minutesAndSecondsTranscurred)