-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtest.js
35 lines (23 loc) · 828 Bytes
/
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
30
31
32
33
34
35
var Lollib = require('./lib/main.js');
var async = require('async');
var lol = new Lollib({
secure: true,
host: 'api.riotgames.com',
path: '/lol/',
key: 'ddad33ef-e7a4-4d99-8af8-aa8bf5260db0', // TEST API KEY -> Better get your own cause if not rate limit will be exceeded all time
debug: true
});
/*lol.getSummonerByName('euw', 'NSZombie', function (err, res){
console.log(err, res);
});
*/
lol.getChallengerLeagueByGametype('euw', 'RANKED_SOLO_5x5', function (err, res){
console.log('Err:' + err, 'Players in Challenger queue: ' + res.entries.length);
});
lol.getChampions('euw', true, function (err, res) {
async.map(res.champions, function (champion, callback){
callback(null, champion.id)
}, function (err, champions){
console.log('Err:' + err, 'Free champions:' + champions.join(', '));
});
});