황성연

스펠 정보 받아오기

......@@ -213,6 +213,11 @@ module.exports = function(app){
{ "mmr" : 2700, "tier" : "challenger", "rank": 1 },
]
var spellUrl = "http://ddragon.leagueoflegends.com/cdn/10.12.1/data/en_US/summoner.json";
request(spellUrl,function(error,response,body){
var spell = (JSON.parse(body)).data;
console.log(spell);
var spectatorUrl = "https://kr.api.riotgames.com/lol/spectator/v4/active-games/by-summoner/" + urlenconde(id) + "?api_key=" + apikey;
request(spectatorUrl,function(error,response,body) {
......@@ -232,9 +237,17 @@ module.exports = function(app){
var spec_mapId = spectator_json.mapId;
var spec_participants = spectator_json.participants;
// var spec_bannedChamp_Id = new Array();
var spec_bannedChamp_image = new Array();
var spec_selectedChamp_image = new Array();
var spec_summonername = new Array();
var spec_spellId = new Array();
for(var i=0; i<10; i++){
spec_summonername.push(spec_participants[i].summonerName);
spec_spellId.push(spec_participants[i].spell1Id);
spec_spellId.push(spec_participants[i].spell2Id);
}
console.log(spec_spellId);
for(var i=0; i<10; i++) {
......@@ -246,6 +259,7 @@ module.exports = function(app){
spec_selectedChamp_image.push("http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"+champion[key].id+".png");
}
}
}
}
......@@ -261,14 +275,13 @@ module.exports = function(app){
match_gameId.push(match_json[i].gameId);
match_mychamp.push(match_json[i].champion);
}
console.log(match_gameId);
console.log(match_mychamp);
// teamId: 100 = Blue , teamId:200 = Red
var match1Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[0] + "?api_key=" + apikey;
request(match1Url,function(error,response,body){
var match1_json=JSON.parse(body);
console.log(match1_json);
......@@ -353,6 +366,7 @@ module.exports = function(app){
});
});
});
});
});
});
});
......