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-06 19:06:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3a49148f6530c0ca64ade14f4099147e22232c0e
3a49148f
1 parent
16e2f9ea
10 matches win/lose champ kda edited
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
182 additions
and
136 deletions
LOL_Helper/app.js
LOL_Helper/router/Test.js
LOL_Helper/router/main.js
LOL_Helper/views/index.ejs
LOL_Helper/app.js
View file @
3a49148
...
...
@@ -8,7 +8,7 @@ app.set('view engine', 'ejs');
app
.
engine
(
'html'
,
require
(
'ejs'
).
renderFile
);
var
server
=
app
.
listen
(
3000
,
function
(){
console
.
log
(
'
good
'
);
console
.
log
(
'
Success
'
);
});
app
.
use
(
express
.
static
(
'public'
));
\ No newline at end of file
...
...
LOL_Helper/router/Test.js
View file @
3a49148
module
.
exports
=
function
(
app
){
function
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
num
)
{
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
if
(
info_match
[
"participants"
][
i
][
"championId"
]
==
championId
[
num
])
{
win
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"win"
];
kills
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"kills"
];
deaths
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"deaths"
];
assists
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"assists"
];
}
}
}
module
.
exports
=
function
(
app
)
{
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-3b791531-e731-4349-bab0-53068a86608c"
//api
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-a0598a8a-a326-4c0d-a115-3f0ae332e86f"
;
//api
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
var
id
;
//소환사ID
var
accountId
;
//계정Id
var
name
;
//소환사 이름
var
summonerLevel
;
//소환사
var
rotation_champ
=
new
Array
();
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
var
id
;
//소환사ID
var
accountId
;
//계정Id
var
name
;
//소환사 이름
var
summonerLevel
;
//소환사
var
rotation_champ
=
new
Array
();
app
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
render
(
'main'
,
{
title
:
'LOL Helper'
});
});
app
.
get
(
'/search/:username/'
,
function
(
req
,
res
,
next
)
{
app
.
get
(
'/search/:username/'
,
function
(
req
,
res
,
next
)
{
//롤 api url
name
=
req
.
params
.
username
;
var
nameUrl
=
"https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/"
+
urlenconde
(
name
)
+
"?api_key="
+
apikey
;
request
(
nameUrl
,
function
(
error
,
response
,
body
){
var
nameUrl
=
"https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/"
+
urlenconde
(
name
)
+
"?api_key="
+
apikey
;
request
(
nameUrl
,
function
(
error
,
response
,
body
)
{
// 요청에 대한 응답이 성공적으로 왔는지 검사.
// status code가 200이 아니면 오류가 있었던 것으로 간주하고 함수 종료.
console
.
log
(
'response code '
,
response
.
statusCode
);
...
...
@@ -41,18 +51,16 @@ var rotation_champ = new Array();
revisionDate
=
info_summoner_json
[
"revisionDate"
];
var
champUrl
=
"https://kr.api.riotgames.com/lol/champion-mastery/v4/champion-masteries/by-summoner/"
+
urlenconde
(
id
)
+
"?api_key="
+
apikey
;
request
(
champUrl
,
function
(
error
,
response
,
body
){
request
(
champUrl
,
function
(
error
,
response
,
body
){
var
info_champ_json
=
JSON
.
parse
(
body
);
var
champ_point
=
new
Array
();
var
champ_id
=
new
Array
();
var
champ_name
=
new
Array
();
var
rotation_name
=
new
Array
();
var
champ_pic
=
new
Array
();
var
rotation_pic
=
new
Array
();
var
rotation_pic
=
new
Array
();
var
champions_length
=
Object
.
keys
(
info_champ_json
).
length
;
//console.log("\n\ninfo_champ_json\n\n", info_champ_json);
// status code가 200이 아니면 종료.
if
(
info_champ_json
[
"status"
]
!=
undefined
)
{
if
(
info_champ_json
[
"status"
][
"status_code"
]
!=
200
)
{
...
...
@@ -62,96 +70,90 @@ var rotation_champ = new Array();
}
}
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
)
{
champ_point
[
i
]
=
(
info_champ_json
[
i
][
"championPoints"
]);
champ_id
[
i
]
=
info_champ_json
[
i
][
"championId"
];
}
var
rotationUrl
=
"https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="
+
apikey
;
request
(
rotationUrl
,
function
(
error
,
response
,
body
)
{
var
rotationUrl
=
"https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="
+
apikey
;
request
(
rotationUrl
,
function
(
error
,
response
,
body
)
{
var
info_rotation
=
JSON
.
parse
(
body
);
var
keys
=
Object
.
keys
(
info_rotation
);
for
(
var
k
=
0
;
k
<
info_rotation
[
keys
[
0
]].
length
;
k
++
)
{
rotation_champ
[
k
]
=
info_rotation
[
keys
[
0
]][
k
]
console
.
log
(
"rotation_champ:"
+
rotation_champ
[
k
]);
console
.
log
(
"로테길이:"
+
rotation_champ
.
length
);
for
(
var
k
=
0
;
k
<
info_rotation
[
keys
[
0
]].
length
;
k
++
)
{
rotation_champ
[
k
]
=
info_rotation
[
keys
[
0
]][
k
];
}
var
staticUrl
=
"http://ddragon.leagueoflegends.com/cdn/9.23.1/data/en_US/champion.json"
;
request
(
staticUrl
,
function
(
error
,
response
,
body
)
{
request
(
staticUrl
,
function
(
error
,
response
,
body
)
{
var
info_static_champ_json
=
JSON
.
parse
(
body
);
var
champion
=
info_static_champ_json
[
"data"
];
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
js
in
champion
)
{
for
(
j
in
champion
[
js
])
{
if
(
champion
[
js
][
"key"
]
==
champ_id
[
i
])
{
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
js
in
champion
)
{
for
(
j
in
champion
[
js
])
{
if
(
champion
[
js
][
"key"
]
==
champ_id
[
i
])
{
champ_name
[
i
]
=
champion
[
js
][
"id"
];
champ_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"
+
champ_name
[
i
]
+
".png"
;
}
}
}
}
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
js
in
champion
)
{
for
(
j
in
champion
[
js
])
{
if
(
champion
[
js
][
"key"
]
==
rotation_champ
[
i
])
{
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
js
in
champion
)
{
for
(
j
in
champion
[
js
])
{
if
(
champion
[
js
][
"key"
]
==
rotation_champ
[
i
])
{
rotation_name
[
i
]
=
champion
[
js
][
"id"
];
rotation_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"
+
rotation_name
[
i
]
+
".png"
;
rotation_pic
[
i
]
=
"http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"
+
rotation_name
[
i
]
+
".png"
;
}
}
}
}
console
.
log
(
"챔프길이:"
+
champ_pic
.
length
);
var
userLeagueUrl
=
"https://kr.api.riotgames.com/lol/league/v4/entries/by-summoner/"
+
urlenconde
(
id
)
+
"?api_key="
+
apikey
;
request
(
userLeagueUrl
,
function
(
error
,
response
,
body
){
var
userLeagueUrl
=
"https://kr.api.riotgames.com/lol/league/v4/entries/by-summoner/"
+
urlenconde
(
id
)
+
"?api_key="
+
apikey
;
request
(
userLeagueUrl
,
function
(
error
,
response
,
body
){
var
info_user_league_json
=
JSON
.
parse
(
body
);
//console.log("userLeagueUrl:", userLeagueUrl);
if
(
info_user_league_json
[
0
]
!=
null
){
if
(
info_user_league_json
[
0
]
!=
null
)
{
var
leagueId
=
info_user_league_json
[
0
][
"leagueId"
];
var
wins
=
info_user_league_json
[
0
][
"wins"
];
var
losses
=
info_user_league_json
[
0
][
"losses"
];
var
leagueName
=
info_user_league_json
[
0
][
"leagueName"
]
var
leagueName
=
info_user_league_json
[
0
][
"leagueName"
];
var
tier
=
info_user_league_json
[
0
][
"tier"
];
var
rank
=
info_user_league_json
[
0
][
"rank"
];
var
leaguePoints
=
info_user_league_json
[
0
][
"leaguePoints"
];
var
img_tier
;
if
(
tier
==
"MASTER"
)
{
if
(
tier
==
"MASTER"
)
{
img_tier
=
"https://i.imgur.com/nvQjonh.png"
;
}
else
if
(
tier
==
"CHALLENGER"
){
}
else
if
(
tier
==
"CHALLENGER"
)
{
img_tier
=
"https://i.imgur.com/sbK1Edj.png"
;
}
else
if
(
tier
==
"DIAMOND"
){
img_tier
=
"https://i.imgur.com/5VBu8PF.png"
}
else
if
(
tier
==
"PLATINUM"
){
img_tier
=
"https://i.imgur.com/Eqi6858.png"
}
else
if
(
tier
==
"GRANDMASTER"
){
img_tier
=
"https://i.imgur.com/mcEhz1o.png"
}
else
if
(
tier
==
"GOLD"
){
img_tier
=
"https://i.imgur.com/Ec4hPuO.png"
}
else
if
(
tier
==
"SILVER"
){
img_tier
=
"https://i.imgur.com/GKnPu7s.png"
}
else
if
(
tier
==
"BRONZE"
){
img_tier
=
"https://i.imgur.com/TPZVXIr.png"
}
else
{
img_tier
=
"https://i.imgur.com/kcdoC4r.png"
}
}
else
if
(
tier
==
"DIAMOND"
)
{
img_tier
=
"https://i.imgur.com/5VBu8PF.png"
;
}
else
if
(
tier
==
"PLATINUM"
)
{
img_tier
=
"https://i.imgur.com/Eqi6858.png"
;
}
else
if
(
tier
==
"GRANDMASTER"
)
{
img_tier
=
"https://i.imgur.com/mcEhz1o.png"
;
}
else
if
(
tier
==
"GOLD"
)
{
img_tier
=
"https://i.imgur.com/Ec4hPuO.png"
;
}
else
if
(
tier
==
"SILVER"
)
{
img_tier
=
"https://i.imgur.com/GKnPu7s.png"
;
}
else
if
(
tier
==
"BRONZE"
)
{
img_tier
=
"https://i.imgur.com/TPZVXIr.png"
;
}
else
{
img_tier
=
"https://i.imgur.com/kcdoC4r.png"
;
}
}
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
);
var
gameId
=
new
Array
();
var
championId
=
new
Array
();
var
picture
=
new
Array
();
if
(
info_matchList
[
"matches"
]
!=
null
)
{
var
gameId
=
info_matchList
[
"matches"
][
0
][
"gameId"
];
for
(
var
num
=
0
;
num
<
10
;
num
++
){
if
(
info_matchList
[
"matches"
]
!=
null
)
{
for
(
var
num
=
0
;
num
<
10
;
num
++
)
{
gameId
[
num
]
=
info_matchList
[
"matches"
][
num
][
"gameId"
];
championId
[
num
]
=
info_matchList
[
"matches"
][
num
][
"champion"
];
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
j
in
champion
)
{
...
...
@@ -162,93 +164,131 @@ var rotation_champ = new Array();
}
}
}
var
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
)
+
"?api_key="
+
apikey
;
var
win
=
new
Array
();
var
kills
=
new
Array
();
var
deaths
=
new
Array
();
var
assists
=
new
Array
();
var
matchUrl
;
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
0
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
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
[
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"
];
var
assists
=
info_match
[
"participants"
][
i
][
"stats"
][
"assists"
];
}
}
}
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
0
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
1
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
1
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
2
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
2
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
3
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
3
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
4
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
4
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
5
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
5
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
6
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
6
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
7
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
7
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
8
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
8
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
9
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
9
);
champ_name
[
champ_name
.
length
]
=
"total"
;
var
temp_id
;
var
temp_name
;
var
temp_point
;
var
temp_pic
;
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
champ_id
.
length
-
1
;
j
++
)
if
(
champ_point
[
i
]
>
champ_point
[
j
])
{
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
champ_id
.
length
-
1
;
j
++
)
{
if
(
champ_point
[
i
]
>
champ_point
[
j
])
{
temp_id
=
champ_id
[
i
];
temp_name
=
champ_name
[
i
];
temp_point
=
champ_point
[
i
];
temp_pic
=
champ_pic
[
i
];
champ_id
[
i
]
=
champ_id
[
j
]
champ_id
[
i
]
=
champ_id
[
j
];
champ_name
[
i
]
=
champ_name
[
j
];
champ_point
[
i
]
=
champ_point
[
j
];
champ_pic
[
i
]
=
champ_pic
[
j
];
champ_id
[
j
]
=
temp_id
champ_id
[
j
]
=
temp_id
;
champ_name
[
j
]
=
temp_name
;
champ_point
[
j
]
=
temp_point
;
champ_pic
[
j
]
=
temp_pic
;
}
}
}
const
defaultMMR
=
[
{
"mmr"
:
900
,
"tier"
:
"iron"
,
"rank"
:
4
},
{
"mmr"
:
950
,
"tier"
:
"iron"
,
"rank"
:
3
},
{
"mmr"
:
1000
,
"tier"
:
"iron"
,
"rank"
:
2
},
{
"mmr"
:
1050
,
"tier"
:
"iron"
,
"rank"
:
1
},
{
"mmr"
:
1100
,
"tier"
:
"bronze"
,
"rank"
:
4
},
{
"mmr"
:
1150
,
"tier"
:
"bronze"
,
"rank"
:
3
},
{
"mmr"
:
1200
,
"tier"
:
"bronze"
,
"rank"
:
2
},
{
"mmr"
:
1250
,
"tier"
:
"bronze"
,
"rank"
:
1
},
{
"mmr"
:
1300
,
"tier"
:
"silver"
,
"rank"
:
4
},
{
"mmr"
:
1350
,
"tier"
:
"silver"
,
"rank"
:
3
},
{
"mmr"
:
1400
,
"tier"
:
"silver"
,
"rank"
:
2
},
{
"mmr"
:
1450
,
"tier"
:
"silver"
,
"rank"
:
1
},
{
"mmr"
:
1500
,
"tier"
:
"gold"
,
"rank"
:
4
},
{
"mmr"
:
1550
,
"tier"
:
"gold"
,
"rank"
:
3
},
{
"mmr"
:
1600
,
"tier"
:
"gold"
,
"rank"
:
2
},
{
"mmr"
:
1650
,
"tier"
:
"gold"
,
"rank"
:
1
},
{
"mmr"
:
1700
,
"tier"
:
"platinum"
,
"rank"
:
4
},
{
"mmr"
:
1750
,
"tier"
:
"platinum"
,
"rank"
:
3
},
{
"mmr"
:
1800
,
"tier"
:
"platinum"
,
"rank"
:
2
},
{
"mmr"
:
1850
,
"tier"
:
"platinum"
,
"rank"
:
1
},
{
"mmr"
:
1900
,
"tier"
:
"diamond"
,
"rank"
:
4
},
{
"mmr"
:
1950
,
"tier"
:
"diamond"
,
"rank"
:
3
},
{
"mmr"
:
2000
,
"tier"
:
"diamond"
,
"rank"
:
2
},
{
"mmr"
:
2050
,
"tier"
:
"diamond"
,
"rank"
:
1
},
{
"mmr"
:
2100
,
"tier"
:
"master"
,
"rank"
:
1
},
{
"mmr"
:
2700
,
"tier"
:
"challenger"
,
"rank"
:
1
},
{
"mmr"
:
900
,
"tier"
:
"iron"
,
"rank"
:
4
},
{
"mmr"
:
950
,
"tier"
:
"iron"
,
"rank"
:
3
},
{
"mmr"
:
1000
,
"tier"
:
"iron"
,
"rank"
:
2
},
{
"mmr"
:
1050
,
"tier"
:
"iron"
,
"rank"
:
1
},
{
"mmr"
:
1100
,
"tier"
:
"bronze"
,
"rank"
:
4
},
{
"mmr"
:
1150
,
"tier"
:
"bronze"
,
"rank"
:
3
},
{
"mmr"
:
1200
,
"tier"
:
"bronze"
,
"rank"
:
2
},
{
"mmr"
:
1250
,
"tier"
:
"bronze"
,
"rank"
:
1
},
{
"mmr"
:
1300
,
"tier"
:
"silver"
,
"rank"
:
4
},
{
"mmr"
:
1350
,
"tier"
:
"silver"
,
"rank"
:
3
},
{
"mmr"
:
1400
,
"tier"
:
"silver"
,
"rank"
:
2
},
{
"mmr"
:
1450
,
"tier"
:
"silver"
,
"rank"
:
1
},
{
"mmr"
:
1500
,
"tier"
:
"gold"
,
"rank"
:
4
},
{
"mmr"
:
1550
,
"tier"
:
"gold"
,
"rank"
:
3
},
{
"mmr"
:
1600
,
"tier"
:
"gold"
,
"rank"
:
2
},
{
"mmr"
:
1650
,
"tier"
:
"gold"
,
"rank"
:
1
},
{
"mmr"
:
1700
,
"tier"
:
"platinum"
,
"rank"
:
4
},
{
"mmr"
:
1750
,
"tier"
:
"platinum"
,
"rank"
:
3
},
{
"mmr"
:
1800
,
"tier"
:
"platinum"
,
"rank"
:
2
},
{
"mmr"
:
1850
,
"tier"
:
"platinum"
,
"rank"
:
1
},
{
"mmr"
:
1900
,
"tier"
:
"diamond"
,
"rank"
:
4
},
{
"mmr"
:
1950
,
"tier"
:
"diamond"
,
"rank"
:
3
},
{
"mmr"
:
2000
,
"tier"
:
"diamond"
,
"rank"
:
2
},
{
"mmr"
:
2050
,
"tier"
:
"diamond"
,
"rank"
:
1
},
{
"mmr"
:
2100
,
"tier"
:
"master"
,
"rank"
:
1
},
{
"mmr"
:
2700
,
"tier"
:
"challenger"
,
"rank"
:
1
},
]
res
.
render
(
'index'
,
{
title
:
req
.
params
.
username
,
c_id
:
champ_id
,
c_name
:
champ_name
,
c_point
:
champ_point
,
c_pic
:
champ_pic
,
c_id
:
champ_id
,
c_name
:
champ_name
,
c_point
:
champ_point
,
c_pic
:
champ_pic
,
c_rotation
:
rotation_pic
,
c_summoner
:
summoner
,
c_wins
:
wins
,
c_losses
:
losses
,
c_tier
:
tier
,
c_imgtier
:
img_tier
,
c_rank
:
rank
,
c_leaguePoint
:
leaguePoints
,
c_summoner
:
summoner
,
c_wins
:
wins
,
c_losses
:
losses
,
c_tier
:
tier
,
c_imgtier
:
img_tier
,
c_rank
:
rank
,
c_leaguePoint
:
leaguePoints
,
c_gameId
:
gameId
,
c_championId
:
championId
,
c_win
:
win
,
c_kills
:
kills
,
c_deaths
:
deaths
,
c_assists
:
assists
,
c_picture
:
picture
c_pic
:
picture
});
});
});
});
});
});
});
});
});
});
});
});
...
...
LOL_Helper/router/main.js
View file @
3a49148
...
...
@@ -2,7 +2,7 @@ module.exports = function(app){
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-
3b791531-e731-4349-bab0-53068a86608c
"
//api
var
apikey
=
"RGAPI-
a0598a8a-a326-4c0d-a115-3f0ae332e86f
"
//api
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
...
...
LOL_Helper/views/index.ejs
View file @
3a49148
...
...
@@ -42,7 +42,6 @@
<tr><td>
<
%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%>
</td></tr>
<tr><td>
<
%= "Win : " + c_wins + " / Lose : " + c_losses%>
</td></tr>
<tr><td>
<
%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %>
</td></tr>
<tr><td>
<
%= "캐리력 : " + (c_wins/c_losses*2).toFixed(2) %>
</td></tr>
</tbody>
</table>
<br></br>
...
...
@@ -53,12 +52,19 @@
<
% for (var i=0; i
<c
_rotation
.
length-1
;
i
++){
%
>
<img
src=
<%=c_rotation[i]%
>
width=50, height=50>
<
% } %>
</div>
<br></br>
<
% for (var i = 0; i
< 10
;
i
++){
%
>
<img
src =
<%=
c_picture
[
i
]%
>
width = 50, height = 50>
<
% if (c_win[i]) { %>
<
%= "승리" %>
<
% } %>
<
% if (!c_win[i]) { %>
<
%= "패배" %>
<
% } %>
<img
src=
<%=
c_pic
[
i
]%
>
width=50, height=50>
<
%= c_kills[i] + " / " + c_deaths[i] + " / " + c_assists[i] %>
<br></br>
<
% } %>
<
%= c_kills + " / " + c_deaths + " / " + c_assists %>
</div>
</body>
</html>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment