Showing
3 changed files
with
31 additions
and
13 deletions
1 | -function func(info_match, championId, win, kills, deaths, assists, num) { | 1 | +function func(info_match, championId, win, kills, deaths, assists, largestMultiKill, num) { |
2 | for (var i = 0; i < 10; i++) { | 2 | for (var i = 0; i < 10; i++) { |
3 | if (info_match["participants"][i]["championId"] == championId[num]) { | 3 | if (info_match["participants"][i]["championId"] == championId[num]) { |
4 | win[num] = info_match["participants"][i]["stats"]["win"]; | 4 | win[num] = info_match["participants"][i]["stats"]["win"]; |
5 | kills[num] = info_match["participants"][i]["stats"]["kills"]; | 5 | kills[num] = info_match["participants"][i]["stats"]["kills"]; |
6 | deaths[num] = info_match["participants"][i]["stats"]["deaths"]; | 6 | deaths[num] = info_match["participants"][i]["stats"]["deaths"]; |
7 | assists[num] = info_match["participants"][i]["stats"]["assists"]; | 7 | assists[num] = info_match["participants"][i]["stats"]["assists"]; |
8 | + largestMultiKill[num] = info_match["participants"][i]["stats"]["largestMultiKill"] | ||
8 | } | 9 | } |
9 | } | 10 | } |
10 | } | 11 | } |
... | @@ -13,7 +14,7 @@ module.exports = function(app) { | ... | @@ -13,7 +14,7 @@ module.exports = function(app) { |
13 | 14 | ||
14 | var request = require("request"); | 15 | var request = require("request"); |
15 | var urlenconde = require('urlencode'); | 16 | var urlenconde = require('urlencode'); |
16 | - var apikey = "RGAPI-99907b0b-aeeb-4ea0-9450-c4758fb672c1"; //api | 17 | + var apikey = "RGAPI-720b5005-7e3d-4f52-909f-6c35d45ed856"; //api |
17 | 18 | ||
18 | var profileIconId; //아이콘 번호 | 19 | var profileIconId; //아이콘 번호 |
19 | var revisionDate; //수정날짜 | 20 | var revisionDate; //수정날짜 |
... | @@ -168,47 +169,48 @@ module.exports = function(app) { | ... | @@ -168,47 +169,48 @@ module.exports = function(app) { |
168 | var kills = new Array(); | 169 | var kills = new Array(); |
169 | var deaths = new Array(); | 170 | var deaths = new Array(); |
170 | var assists = new Array(); | 171 | var assists = new Array(); |
172 | + var largestMultiKill = new Array(); | ||
171 | var matchUrl; | 173 | var matchUrl; |
172 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[0]) + "?api_key=" + apikey; | 174 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[0]) + "?api_key=" + apikey; |
173 | request(matchUrl, function(error, response, body){ | 175 | request(matchUrl, function(error, response, body){ |
174 | var info_match = JSON.parse(body); | 176 | var info_match = JSON.parse(body); |
175 | - func(info_match, championId, win, kills, deaths, assists, 0); | 177 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 0); |
176 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[1]) + "?api_key=" + apikey; | 178 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[1]) + "?api_key=" + apikey; |
177 | request(matchUrl, function(error, response, body){ | 179 | request(matchUrl, function(error, response, body){ |
178 | var info_match = JSON.parse(body); | 180 | var info_match = JSON.parse(body); |
179 | - func(info_match, championId, win, kills, deaths, assists, 1); | 181 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 1); |
180 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[2]) + "?api_key=" + apikey; | 182 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[2]) + "?api_key=" + apikey; |
181 | request(matchUrl, function(error, response, body){ | 183 | request(matchUrl, function(error, response, body){ |
182 | var info_match = JSON.parse(body); | 184 | var info_match = JSON.parse(body); |
183 | - func(info_match, championId, win, kills, deaths, assists, 2); | 185 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 2); |
184 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[3]) + "?api_key=" + apikey; | 186 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[3]) + "?api_key=" + apikey; |
185 | request(matchUrl, function(error, response, body){ | 187 | request(matchUrl, function(error, response, body){ |
186 | var info_match = JSON.parse(body); | 188 | var info_match = JSON.parse(body); |
187 | - func(info_match, championId, win, kills, deaths, assists, 3); | 189 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 3); |
188 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[4]) + "?api_key=" + apikey; | 190 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[4]) + "?api_key=" + apikey; |
189 | request(matchUrl, function(error, response, body){ | 191 | request(matchUrl, function(error, response, body){ |
190 | var info_match = JSON.parse(body); | 192 | var info_match = JSON.parse(body); |
191 | - func(info_match, championId, win, kills, deaths, assists, 4); | 193 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 4); |
192 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[5]) + "?api_key=" + apikey; | 194 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[5]) + "?api_key=" + apikey; |
193 | request(matchUrl, function(error, response, body){ | 195 | request(matchUrl, function(error, response, body){ |
194 | var info_match = JSON.parse(body); | 196 | var info_match = JSON.parse(body); |
195 | - func(info_match, championId, win, kills, deaths, assists, 5); | 197 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 5); |
196 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[6]) + "?api_key=" + apikey; | 198 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[6]) + "?api_key=" + apikey; |
197 | request(matchUrl, function(error, response, body){ | 199 | request(matchUrl, function(error, response, body){ |
198 | var info_match = JSON.parse(body); | 200 | var info_match = JSON.parse(body); |
199 | - func(info_match, championId, win, kills, deaths, assists, 6); | 201 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 6); |
200 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[7]) + "?api_key=" + apikey; | 202 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[7]) + "?api_key=" + apikey; |
201 | request(matchUrl, function(error, response, body){ | 203 | request(matchUrl, function(error, response, body){ |
202 | var info_match = JSON.parse(body); | 204 | var info_match = JSON.parse(body); |
203 | - func(info_match, championId, win, kills, deaths, assists, 7); | 205 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 7); |
204 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[8]) + "?api_key=" + apikey; | 206 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[8]) + "?api_key=" + apikey; |
205 | request(matchUrl, function(error, response, body){ | 207 | request(matchUrl, function(error, response, body){ |
206 | var info_match = JSON.parse(body); | 208 | var info_match = JSON.parse(body); |
207 | - func(info_match, championId, win, kills, deaths, assists, 8); | 209 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 8); |
208 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[9]) + "?api_key=" + apikey; | 210 | matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[9]) + "?api_key=" + apikey; |
209 | request(matchUrl, function(error, response, body){ | 211 | request(matchUrl, function(error, response, body){ |
210 | var info_match = JSON.parse(body); | 212 | var info_match = JSON.parse(body); |
211 | - func(info_match, championId, win, kills, deaths, assists, 9); | 213 | + func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 9); |
212 | champ_name[champ_name.length] = "total"; | 214 | champ_name[champ_name.length] = "total"; |
213 | var temp_id; | 215 | var temp_id; |
214 | var temp_name; | 216 | var temp_name; |
... | @@ -279,6 +281,7 @@ module.exports = function(app) { | ... | @@ -279,6 +281,7 @@ module.exports = function(app) { |
279 | c_kills : kills, | 281 | c_kills : kills, |
280 | c_deaths : deaths, | 282 | c_deaths : deaths, |
281 | c_assists : assists, | 283 | c_assists : assists, |
284 | + c_largestMultiKill : largestMultiKill, | ||
282 | c_pic : picture | 285 | c_pic : picture |
283 | }); | 286 | }); |
284 | }); | 287 | }); | ... | ... |
... | @@ -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-99907b0b-aeeb-4ea0-9450-c4758fb672c1"//api | 5 | +var apikey = "RGAPI-720b5005-7e3d-4f52-909f-6c35d45ed856"//api |
6 | 6 | ||
7 | var profileIconId; //아이콘 번호 | 7 | var profileIconId; //아이콘 번호 |
8 | var revisionDate; //수정날짜 | 8 | var revisionDate; //수정날짜 | ... | ... |
... | @@ -85,6 +85,21 @@ | ... | @@ -85,6 +85,21 @@ |
85 | <% if (c_deaths[i] != 0) { %> | 85 | <% if (c_deaths[i] != 0) { %> |
86 | <%= ((c_kills[i] + c_assists[i]) / c_deaths[i]).toFixed(2) %> | 86 | <%= ((c_kills[i] + c_assists[i]) / c_deaths[i]).toFixed(2) %> |
87 | <% } %> | 87 | <% } %> |
88 | + | ||
89 | + <span style = "color : red"> | ||
90 | + <% if (c_largestMultiKill[i] == 2) { %> | ||
91 | + <%= "\t더블킬" %> | ||
92 | + <% } %> | ||
93 | + <% if (c_largestMultiKill[i] == 3) { %> | ||
94 | + <%= "\t트리플킬" %> | ||
95 | + <% } %> | ||
96 | + <% if (c_largestMultiKill[i] == 4) { %> | ||
97 | + <%= "\t쿼드라킬" %> | ||
98 | + <% } %> | ||
99 | + <% if (c_largestMultiKill[i] == 5) { %> | ||
100 | + <%= "\t펜타킬" %> | ||
101 | + <% } %> | ||
102 | + </span> | ||
88 | <br></br> | 103 | <br></br> |
89 | <% } %> | 104 | <% } %> |
90 | </b> | 105 | </b> | ... | ... |
-
Please register or login to post a comment