Showing
3 changed files
with
15 additions
and
9 deletions
... | @@ -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-c5e0eeb2-256e-46c6-baa1-d27b1e907d6c"//api | 5 | +var apikey = "RGAPI-3b791531-e731-4349-bab0-53068a86608c"//api |
6 | 6 | ||
7 | var profileIconId; //아이콘 번호 | 7 | var profileIconId; //아이콘 번호 |
8 | var revisionDate; //수정날짜 | 8 | var revisionDate; //수정날짜 |
... | @@ -147,14 +147,17 @@ var rotation_champ = new Array(); | ... | @@ -147,14 +147,17 @@ var rotation_champ = new Array(); |
147 | var matchListUrl = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/" + urlenconde(accountId) + "?api_key=" + apikey; | 147 | var matchListUrl = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/" + urlenconde(accountId) + "?api_key=" + apikey; |
148 | request(matchListUrl, function(error, response, body){ | 148 | request(matchListUrl, function(error, response, body){ |
149 | var info_matchList = JSON.parse(body); | 149 | var info_matchList = JSON.parse(body); |
150 | - if(info_matchList["matches"][0] != null){ | 150 | + var championId = new Array(); |
151 | + var picture = new Array(); | ||
152 | + if(info_matchList["matches"] != null){ | ||
151 | var gameId = info_matchList["matches"][0]["gameId"]; | 153 | var gameId = info_matchList["matches"][0]["gameId"]; |
152 | - var championId = info_matchList["matches"][0]["champion"]; | 154 | + for(var num = 0; num < 10; num++){ |
153 | - console.log(champ_name[0]); | 155 | + championId[num] = info_matchList["matches"][num]["champion"]; |
154 | for (var i = 0; i < champ_id.length; i++) { | 156 | for (var i = 0; i < champ_id.length; i++) { |
155 | for (j in champion) { | 157 | for (j in champion) { |
156 | - if (champion[j]["key"] == championId) { | 158 | + if (champion[j]["key"] == championId[num]) { |
157 | - picture = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/" + champion[j]["id"] + ".png"; | 159 | + picture[num] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/" + champion[j]["id"] + ".png"; |
160 | + } | ||
158 | } | 161 | } |
159 | } | 162 | } |
160 | } | 163 | } |
... | @@ -165,7 +168,7 @@ var rotation_champ = new Array(); | ... | @@ -165,7 +168,7 @@ var rotation_champ = new Array(); |
165 | var info_match = JSON.parse(body); | 168 | var info_match = JSON.parse(body); |
166 | if(info_match["teams"] != null){ | 169 | if(info_match["teams"] != null){ |
167 | for (var i = 0; i < 10; i++){ | 170 | for (var i = 0; i < 10; i++){ |
168 | - if(info_match["participants"][i]["championId"] == championId){ | 171 | + if(info_match["participants"][i]["championId"] == championId[0]){ |
169 | var win = info_match["participants"][i]["stats"]["win"]; | 172 | var win = info_match["participants"][i]["stats"]["win"]; |
170 | var kills = info_match["participants"][i]["stats"]["kills"]; | 173 | var kills = info_match["participants"][i]["stats"]["kills"]; |
171 | var deaths = info_match["participants"][i]["stats"]["deaths"]; | 174 | var deaths = info_match["participants"][i]["stats"]["deaths"]; | ... | ... |
... | @@ -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-c5e0eeb2-256e-46c6-baa1-d27b1e907d6c"//api | 5 | +var apikey = "RGAPI-3b791531-e731-4349-bab0-53068a86608c"//api |
6 | 6 | ||
7 | var profileIconId; //아이콘 번호 | 7 | var profileIconId; //아이콘 번호 |
8 | var revisionDate; //수정날짜 | 8 | var revisionDate; //수정날짜 | ... | ... |
... | @@ -54,7 +54,10 @@ | ... | @@ -54,7 +54,10 @@ |
54 | <img src= <%=c_rotation[i]%> width=50, height=50> | 54 | <img src= <%=c_rotation[i]%> width=50, height=50> |
55 | <% } %> | 55 | <% } %> |
56 | <br></br> | 56 | <br></br> |
57 | - <img src = <%= c_picture%> width = 50, height = 50> | 57 | + <% for (var i = 0; i < 10; i++){ %> |
58 | + <img src = <%= c_picture[i]%> width = 50, height = 50> | ||
59 | + <br></br> | ||
60 | + <% } %> | ||
58 | <%= c_kills + " / " + c_deaths + " / " + c_assists %> | 61 | <%= c_kills + " / " + c_deaths + " / " + c_assists %> |
59 | </div> | 62 | </div> |
60 | </body> | 63 | </body> | ... | ... |
-
Please register or login to post a comment