Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오윤석
/
maplespec.ga
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
4
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2020-06-18 04:35:32 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8ed917f1ebe23aa5f56ecb96e70229d937ab510b
8ed917f1
1 parent
bbeca3ea
리부트 캐릭터 가져오지 못하는 오류 수정
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
app/node/routes/character.js
app/node/routes/character.js
View file @
8ed917f
axios
=
require
(
'axios'
);
const
crwalCharacterCode
=
async
function
(
nickname
)
{
const
crwalCharacterCode
=
async
function
(
nickname
,
isReboot
=
false
)
{
try
{
const
resp
=
await
axios
.
get
(
"https://maplestory.nexon.com/Ranking/World/Total?c="
+
encodeURI
(
nickname
));
const
resp
=
await
axios
.
get
(
"https://maplestory.nexon.com/Ranking/World/Total?c="
+
encodeURI
(
nickname
)
+
"&w="
+
(
isReboot
?
"0"
:
"254"
)
);
const
regex
=
new
RegExp
(
`<dt><a href=\\"\\/Common\\/Character\\/Detail\\/[^\\?]+?\\?p=(.+?)\\"\\s+target=.+?\\/>
${
nickname
}
<\\/a><\\/dt>`
);
const
regexResult
=
regex
.
exec
(
resp
.
data
);
if
(
!
regexResult
)
if
(
!
regexResult
)
{
if
(
isReboot
)
return
-
2
;
else
return
await
crwalCharacterCode
(
nickname
,
true
);
}
return
regexResult
[
1
];
}
catch
(
error
)
{
...
...
Please
register
or
login
to post a comment