Showing
1 changed file
with
18 additions
and
4 deletions
... | @@ -213,6 +213,11 @@ module.exports = function(app){ | ... | @@ -213,6 +213,11 @@ module.exports = function(app){ |
213 | { "mmr" : 2700, "tier" : "challenger", "rank": 1 }, | 213 | { "mmr" : 2700, "tier" : "challenger", "rank": 1 }, |
214 | ] | 214 | ] |
215 | 215 | ||
216 | + var spellUrl = "http://ddragon.leagueoflegends.com/cdn/10.12.1/data/en_US/summoner.json"; | ||
217 | + request(spellUrl,function(error,response,body){ | ||
218 | + var spell = (JSON.parse(body)).data; | ||
219 | + console.log(spell); | ||
220 | + | ||
216 | 221 | ||
217 | var spectatorUrl = "https://kr.api.riotgames.com/lol/spectator/v4/active-games/by-summoner/" + urlenconde(id) + "?api_key=" + apikey; | 222 | var spectatorUrl = "https://kr.api.riotgames.com/lol/spectator/v4/active-games/by-summoner/" + urlenconde(id) + "?api_key=" + apikey; |
218 | request(spectatorUrl,function(error,response,body) { | 223 | request(spectatorUrl,function(error,response,body) { |
... | @@ -232,9 +237,17 @@ module.exports = function(app){ | ... | @@ -232,9 +237,17 @@ module.exports = function(app){ |
232 | var spec_mapId = spectator_json.mapId; | 237 | var spec_mapId = spectator_json.mapId; |
233 | var spec_participants = spectator_json.participants; | 238 | var spec_participants = spectator_json.participants; |
234 | 239 | ||
235 | - // var spec_bannedChamp_Id = new Array(); | ||
236 | var spec_bannedChamp_image = new Array(); | 240 | var spec_bannedChamp_image = new Array(); |
237 | var spec_selectedChamp_image = new Array(); | 241 | var spec_selectedChamp_image = new Array(); |
242 | + var spec_summonername = new Array(); | ||
243 | + var spec_spellId = new Array(); | ||
244 | + for(var i=0; i<10; i++){ | ||
245 | + spec_summonername.push(spec_participants[i].summonerName); | ||
246 | + spec_spellId.push(spec_participants[i].spell1Id); | ||
247 | + spec_spellId.push(spec_participants[i].spell2Id); | ||
248 | + } | ||
249 | + console.log(spec_spellId); | ||
250 | + | ||
238 | 251 | ||
239 | for(var i=0; i<10; i++) { | 252 | for(var i=0; i<10; i++) { |
240 | 253 | ||
... | @@ -246,6 +259,7 @@ module.exports = function(app){ | ... | @@ -246,6 +259,7 @@ module.exports = function(app){ |
246 | spec_selectedChamp_image.push("http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"+champion[key].id+".png"); | 259 | spec_selectedChamp_image.push("http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"+champion[key].id+".png"); |
247 | } | 260 | } |
248 | } | 261 | } |
262 | + | ||
249 | } | 263 | } |
250 | } | 264 | } |
251 | 265 | ||
... | @@ -261,14 +275,13 @@ module.exports = function(app){ | ... | @@ -261,14 +275,13 @@ module.exports = function(app){ |
261 | match_gameId.push(match_json[i].gameId); | 275 | match_gameId.push(match_json[i].gameId); |
262 | match_mychamp.push(match_json[i].champion); | 276 | match_mychamp.push(match_json[i].champion); |
263 | } | 277 | } |
264 | - console.log(match_gameId); | ||
265 | - console.log(match_mychamp); | ||
266 | 278 | ||
279 | + // teamId: 100 = Blue , teamId:200 = Red | ||
267 | var match1Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[0] + "?api_key=" + apikey; | 280 | var match1Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[0] + "?api_key=" + apikey; |
268 | request(match1Url,function(error,response,body){ | 281 | request(match1Url,function(error,response,body){ |
269 | var match1_json=JSON.parse(body); | 282 | var match1_json=JSON.parse(body); |
270 | console.log(match1_json); | 283 | console.log(match1_json); |
271 | - | 284 | + |
272 | 285 | ||
273 | 286 | ||
274 | 287 | ||
... | @@ -353,6 +366,7 @@ module.exports = function(app){ | ... | @@ -353,6 +366,7 @@ module.exports = function(app){ |
353 | }); | 366 | }); |
354 | }); | 367 | }); |
355 | }); | 368 | }); |
369 | + }); | ||
356 | }); | 370 | }); |
357 | }); | 371 | }); |
358 | }); | 372 | }); | ... | ... |
-
Please register or login to post a comment