박민근

Seccessfully Excuted

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