황성연

최근전적 받아오기, 티어별 엠블렘 이미지 추가

......@@ -257,14 +257,69 @@ module.exports = function(app){
var match_gameId = new Array();
var match_mychamp = new Array();
for(var i=0; i<10; i++){
for(var i=0; i<5; i++){
match_gameId.push(match_json[i].gameId);
match_mychamp.push(match_json[i].champion);
}
console.log(match_gameId);
console.log(match_mychamp);
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);
var match2Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[1] + "?api_key=" + apikey;
request(match2Url,function(error,response,body){
var match2_json=JSON.parse(body);
console.log(match2_json);
var match3Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[2] + "?api_key=" + apikey;
request(match3Url,function(error,response,body){
var match3_json=JSON.parse(body);
console.log(match3_json);
var match4Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[3] + "?api_key=" + apikey;
request(match4Url,function(error,response,body){
var match4_json=JSON.parse(body);
console.log(match4_json);
var match5Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[4] + "?api_key=" + apikey;
request(match5Url,function(error,response,body){
var match5_json=JSON.parse(body);
console.log(match5_json);
......@@ -274,20 +329,26 @@ module.exports = function(app){
res.render('index', { title: req.params.username ,
c_id: champ_id,
c_name: champ_name,
c_point: champ_point,
c_pic: champ_pic,
c_rotation : rotation_pic,
c_rotation_newbie : rotation_pic_newbie,
c_summoner: summoner,
c_wins: wins,
c_losses: losses,
c_tier: tier,
c_imgtier: img_tier,
c_rank: rank,
c_leaguePoint: leaguePoints
res.render('index', { title: req.params.username ,
c_id: champ_id,
c_name: champ_name,
c_point: champ_point,
c_pic: champ_pic,
c_rotation : rotation_pic,
c_rotation_newbie : rotation_pic_newbie,
c_summoner: summoner,
c_wins: wins,
c_losses: losses,
c_tier: tier,
c_imgtier: img_tier,
c_rank: rank,
c_leaguePoint: leaguePoints
});
});
});
});
});
});
});
});
......