황성연

실시간 경기 데이터 매핑

......@@ -221,12 +221,12 @@ module.exports = function(app){
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) {
var flag = true;
var flag = true; // 실시간 경기 여부
if(response.statusCode != 200)
flag = false;
if(flag) {
if(flag) { // 실시간 경기 진행중이면
var spectator_json = JSON.parse(body);
console.log(spectator_json);
var spec_bannedChamp = spectator_json.bannedChampions;
......@@ -266,6 +266,13 @@ module.exports = function(app){
}
}
}
var spectator = {
"summonerName" : spec_summonerName,
"selectedChamp_image" : spec_selectedChamp_image,
"bannedChamp_image" : spec_bannedChamp_image,
"spell_image" : spec_spell_image
};
}
var matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/" + accountId + "?api_key=" + apikey;
......