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 13:14:31 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2945bc31ad17da3fa54987a067ca91e294a51ae0
2945bc31
1 parent
9db2dbc0
스펠 정보 받아오기
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
lolinfo/router/mytest.js
lolinfo/router/mytest.js
View file @
2945bc3
...
...
@@ -213,6 +213,11 @@ module.exports = function(app){
{
"mmr"
:
2700
,
"tier"
:
"challenger"
,
"rank"
:
1
},
]
var
spellUrl
=
"http://ddragon.leagueoflegends.com/cdn/10.12.1/data/en_US/summoner.json"
;
request
(
spellUrl
,
function
(
error
,
response
,
body
){
var
spell
=
(
JSON
.
parse
(
body
)).
data
;
console
.
log
(
spell
);
var
spectatorUrl
=
"https://kr.api.riotgames.com/lol/spectator/v4/active-games/by-summoner/"
+
urlenconde
(
id
)
+
"?api_key="
+
apikey
;
request
(
spectatorUrl
,
function
(
error
,
response
,
body
)
{
...
...
@@ -232,9 +237,17 @@ module.exports = function(app){
var
spec_mapId
=
spectator_json
.
mapId
;
var
spec_participants
=
spectator_json
.
participants
;
// var spec_bannedChamp_Id = new Array();
var
spec_bannedChamp_image
=
new
Array
();
var
spec_selectedChamp_image
=
new
Array
();
var
spec_summonername
=
new
Array
();
var
spec_spellId
=
new
Array
();
for
(
var
i
=
0
;
i
<
10
;
i
++
){
spec_summonername
.
push
(
spec_participants
[
i
].
summonerName
);
spec_spellId
.
push
(
spec_participants
[
i
].
spell1Id
);
spec_spellId
.
push
(
spec_participants
[
i
].
spell2Id
);
}
console
.
log
(
spec_spellId
);
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
...
...
@@ -246,6 +259,7 @@ module.exports = function(app){
spec_selectedChamp_image
.
push
(
"http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"
+
champion
[
key
].
id
+
".png"
);
}
}
}
}
...
...
@@ -261,14 +275,13 @@ module.exports = function(app){
match_gameId
.
push
(
match_json
[
i
].
gameId
);
match_mychamp
.
push
(
match_json
[
i
].
champion
);
}
console
.
log
(
match_gameId
);
console
.
log
(
match_mychamp
);
// 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
);
console
.
log
(
match1_json
);
...
...
@@ -353,6 +366,7 @@ module.exports = function(app){
});
});
});
});
});
});
});
...
...
Please
register
or
login
to post a comment