이정호

recent 10 matches edited

......@@ -2,7 +2,7 @@ module.exports = function(app){
var request = require("request");
var urlenconde = require('urlencode');
var apikey = "RGAPI-c5e0eeb2-256e-46c6-baa1-d27b1e907d6c"//api
var apikey = "RGAPI-3b791531-e731-4349-bab0-53068a86608c"//api
var profileIconId; //아이콘 번호
var revisionDate; //수정날짜
......@@ -147,14 +147,17 @@ var rotation_champ = new Array();
var matchListUrl = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/" + urlenconde(accountId) + "?api_key=" + apikey;
request(matchListUrl, function(error, response, body){
var info_matchList = JSON.parse(body);
if(info_matchList["matches"][0] != null){
var championId = new Array();
var picture = new Array();
if(info_matchList["matches"] != null){
var gameId = info_matchList["matches"][0]["gameId"];
var championId = info_matchList["matches"][0]["champion"];
console.log(champ_name[0]);
for (var i = 0; i < champ_id.length; i++) {
for (j in champion) {
if (champion[j]["key"] == championId) {
picture = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/" + champion[j]["id"] + ".png";
for(var num = 0; num < 10; num++){
championId[num] = info_matchList["matches"][num]["champion"];
for (var i = 0; i < champ_id.length; i++) {
for (j in champion) {
if (champion[j]["key"] == championId[num]) {
picture[num] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/" + champion[j]["id"] + ".png";
}
}
}
}
......@@ -165,7 +168,7 @@ var rotation_champ = new Array();
var info_match = JSON.parse(body);
if(info_match["teams"] != null){
for (var i = 0; i < 10; i++){
if(info_match["participants"][i]["championId"] == championId){
if(info_match["participants"][i]["championId"] == championId[0]){
var win = info_match["participants"][i]["stats"]["win"];
var kills = info_match["participants"][i]["stats"]["kills"];
var deaths = info_match["participants"][i]["stats"]["deaths"];
......
......@@ -2,7 +2,7 @@ module.exports = function(app){
var request = require("request");
var urlenconde = require('urlencode');
var apikey = "RGAPI-c5e0eeb2-256e-46c6-baa1-d27b1e907d6c"//api
var apikey = "RGAPI-3b791531-e731-4349-bab0-53068a86608c"//api
var profileIconId; //아이콘 번호
var revisionDate; //수정날짜
......
......@@ -54,7 +54,10 @@
<img src= <%=c_rotation[i]%> width=50, height=50>
<% } %>
<br></br>
<img src = <%= c_picture%> width = 50, height = 50>
<% for (var i = 0; i < 10; i++){ %>
<img src = <%= c_picture[i]%> width = 50, height = 50>
<br></br>
<% } %>
<%= c_kills + " / " + c_deaths + " / " + c_assists %>
</div>
</body>
......