박민근

Add champion's names & images

......@@ -2,7 +2,7 @@ module.exports = function(app){
var request = require("request");
var urlenconde = require('urlencode');
var apikey = "RGAPI-83bf5bd8-d355-48f2-8531-d33c1befa920"//api
var apikey = "RGAPI-a7c53f9b-e980-42b3-af78-a3bc291bec7a"//api
var profileIconId; //아이콘 번호
var revisionDate; //수정날짜
......@@ -45,7 +45,7 @@ var matches; //경기정보
for(var i=0; i < champions_length; i++){
champ_point[i] = (info_champ_json[i]["championPoints"]);
champ_id[i] = info_champ_json[i]["championid"];
champ_id[i] = info_champ_json[i]["championId"];
}
var staticUrl = "http://ddragon.leagueoflegends.com/cdn/6.24.1/data/en_US/champion.json";
......@@ -55,9 +55,8 @@ var matches; //경기정보
for(var i=0; i < champ_id.length; i++){
for(js in champion){
for(j in champion[js]){
if(champion[js]["id"] == champ_id[i]){
champ_name[i] = champion[js]["key"];
console.log(champ_name[i]);
if(champion[js]["key"] == champ_id[i]){
champ_name[i] = champion[js]["id"];
champ_pic[i] = "http://ddragon.leagueoflegends.com/cdn/6.24.1/img/champion/"+champ_name[i]+".png";
}
}
......