Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이정호
/
lolhelper
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이정호
2020-06-04 20:53:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
16e2f9ea67a0ea30f7f99549f790fe689eef8a42
16e2f9ea
1 parent
2b12837e
recent 10 matches edited
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
LOL_Helper/router/Test.js
LOL_Helper/router/main.js
LOL_Helper/views/index.ejs
LOL_Helper/router/Test.js
View file @
16e2f9e
...
...
@@ -2,7 +2,7 @@ module.exports = function(app){
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-
c5e0eeb2-256e-46c6-baa1-d27b1e907d6
c"
//api
var
apikey
=
"RGAPI-
3b791531-e731-4349-bab0-53068a86608
c"
//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"
];
...
...
LOL_Helper/router/main.js
View file @
16e2f9e
...
...
@@ -2,7 +2,7 @@ module.exports = function(app){
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-
c5e0eeb2-256e-46c6-baa1-d27b1e907d6
c"
//api
var
apikey
=
"RGAPI-
3b791531-e731-4349-bab0-53068a86608
c"
//api
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
...
...
LOL_Helper/views/index.ejs
View file @
16e2f9e
...
...
@@ -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>
...
...
Please
register
or
login
to post a comment