박민근

Seccessfully Excuted

......@@ -2,7 +2,7 @@ module.exports = function(app){
var request = require("request");
var urlenconde = require('urlencode');
var apikey = "RGAPI-4f69669a-be29-4806-a82b-ffe2db68630d"//api
var apikey = "RGAPI-83bf5bd8-d355-48f2-8531-d33c1befa920"//api
var profileIconId; //아이콘 번호
var revisionDate; //수정날짜
......@@ -37,16 +37,15 @@ var matches; //경기정보
var champUrl = "https://kr.api.riotgames.com/lol/champion-mastery/v3/champion-masteries/by-summoner/" + urlenconde(id) + "?api_key=" + apikey;
request(champUrl,function(error,response,body){
var info_champ_json = JSON.parse(body);
var champions = info_champ_json["champions"];
var champ_point = new Array();
var champ_id = new Array();
var champ_name = new Array();
var champ_pic = new Array();
var champions_length = Object.keys(champions).length;
var champions_length = Object.keys(info_champ_json).length;
for(var i=0; i < champions_length; i++){
champ_point[i] = (champions[i]["championPoints"]);
champ_id[i] = champions[i]["championid"];
champ_point[i] = (info_champ_json[i]["championPoints"]);
champ_id[i] = info_champ_json[i]["championid"];
}
var staticUrl = "http://ddragon.leagueoflegends.com/cdn/6.24.1/data/en_US/champion.json";
......@@ -58,7 +57,8 @@ var matches; //경기정보
for(j in champion[js]){
if(champion[js]["id"] == champ_id[i]){
champ_name[i] = champion[js]["key"];
champ_pic[i] = "http://ddragon.leagueoflegends.com/cdn/6.24.1/img/champion/"+champ_name[i]+".png" ";
console.log(champ_name[i]);
champ_pic[i] = "http://ddragon.leagueoflegends.com/cdn/6.24.1/img/champion/"+champ_name[i]+".png";
}
}
}
......