Toggle navigation
Toggle navigation
This project
Loading...
Sign in
황성연
/
lolinfo.gg
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-21 15:24:49 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d25ad58e20624b532142a77dd51e1f7237c849d9
d25ad58e
1 parent
26c8fb4b
대전 기록 받아오기
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
lolinfo/router/mytest.js
lolinfo/router/mytest.js
View file @
d25ad58
...
...
@@ -239,11 +239,11 @@ module.exports = function(app){
var
spec_bannedChamp_image
=
new
Array
();
var
spec_selectedChamp_image
=
new
Array
();
var
spec_summoner
n
ame
=
new
Array
();
var
spec_summoner
N
ame
=
new
Array
();
var
spec_spellId
=
new
Array
();
var
spec_spellimage
=
new
Array
();
for
(
var
i
=
0
;
i
<
10
;
i
++
){
spec_summoner
n
ame
.
push
(
spec_participants
[
i
].
summonerName
);
spec_summoner
N
ame
.
push
(
spec_participants
[
i
].
summonerName
);
spec_spellId
.
push
(
spec_participants
[
i
].
spell1Id
);
spec_spellId
.
push
(
spec_participants
[
i
].
spell2Id
);
}
...
...
@@ -266,7 +266,6 @@ module.exports = function(app){
}
}
}
console
.
log
(
spec_spellimage
);
}
var
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/"
+
accountId
+
"?api_key="
+
apikey
;
...
...
@@ -285,11 +284,45 @@ module.exports = function(app){
// teamId: 100 = Blue , teamId:200 = Red
var
match1Url
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
match_gameId
[
0
]
+
"?api_key="
+
apikey
;
request
(
match1Url
,
function
(
error
,
response
,
body
){
var
match1_json
=
JSON
.
parse
(
body
);
var
match1_json
=
JSON
.
parse
(
body
);
console
.
log
(
match1_json
);
var
match1_gameLength
=
match_json
.
gameDuration
;
var
match1_teams
=
match1_json
.
teams
;
var
match1_participants
=
match1_json
.
participants
;
var
match1_participantIdentities
=
match1_json
.
participantIdentities
;
var
match1_bannedChamp
=
new
Array
();
var
match1_selectedChamp
=
new
Array
();
var
match1_spellId
=
new
Array
();
var
match1_summonerName
=
new
Array
();
var
match1_kills
=
new
Array
();
var
match1_deaths
=
new
Array
();
var
match1_assists
=
new
Array
();
var
match1_kda
=
new
Array
();
for
(
var
i
=
0
;
i
<
2
;
i
++
){
var
temp
=
match1_teams
[
i
].
bans
;
for
(
var
j
=
0
;
j
<
5
;
j
++
){
match1_bannedChamp
.
push
(
temp
[
j
].
championId
);
}
}
for
(
var
i
=
0
;
i
<
10
;
i
++
){
match1_selectedChamp
.
push
(
match1_participants
[
i
].
championId
);
match1_spellId
.
push
(
match1_participants
[
i
].
spell1Id
);
match1_spellId
.
push
(
match1_participants
[
i
].
spell2Id
);
match1_summonerName
.
push
((
match1_participantIdentities
[
i
].
player
).
summonerName
);
match1_kills
.
push
((
match1_participants
[
i
].
stats
).
kills
);
match1_deaths
.
push
((
match1_participants
[
i
].
stats
).
deaths
);
match1_assists
.
push
((
match1_participants
[
i
].
stats
).
assists
);
var
obj
=
{
'k'
:
(
match1_participants
[
i
].
stats
).
kills
,
'd'
:
(
match1_participants
[
i
].
stats
).
deaths
,
'a'
:
(
match1_participants
[
i
].
stats
).
assists
};
match1_kda
.
push
(
obj
);
}
console
.
log
(
match1_kda
);
...
...
@@ -297,7 +330,6 @@ module.exports = function(app){
var
match2Url
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
match_gameId
[
1
]
+
"?api_key="
+
apikey
;
request
(
match2Url
,
function
(
error
,
response
,
body
){
var
match2_json
=
JSON
.
parse
(
body
);
console
.
log
(
match2_json
);
...
...
@@ -308,7 +340,6 @@ module.exports = function(app){
var
match3Url
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
match_gameId
[
2
]
+
"?api_key="
+
apikey
;
request
(
match3Url
,
function
(
error
,
response
,
body
){
var
match3_json
=
JSON
.
parse
(
body
);
console
.
log
(
match3_json
);
...
...
@@ -318,7 +349,6 @@ module.exports = function(app){
var
match4Url
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
match_gameId
[
3
]
+
"?api_key="
+
apikey
;
request
(
match4Url
,
function
(
error
,
response
,
body
){
var
match4_json
=
JSON
.
parse
(
body
);
console
.
log
(
match4_json
);
...
...
@@ -329,7 +359,6 @@ module.exports = function(app){
var
match5Url
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
match_gameId
[
4
]
+
"?api_key="
+
apikey
;
request
(
match5Url
,
function
(
error
,
response
,
body
){
var
match5_json
=
JSON
.
parse
(
body
);
console
.
log
(
match5_json
);
...
...
Please
register
or
login
to post a comment