Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박찬수
/
enjoy_soccer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박찬수
2022-06-09 03:02:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0615ce8b4e95c906f9ed6d5de379039916bc28e3
0615ce8b
1 parent
a79420d2
appfunctions
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
appfunctions.js
appfunctions.js
View file @
0615ce8
...
...
@@ -17,12 +17,12 @@ function GetGameSchedule(teamID, leagueID, season, eventObj){
}
// 입력: 리그ID, 반환: 팀 순위
function
Get
TeamStanding
(
season
){
function
Get
LeagueStanding
(
leagueID
,
season
){
var
request
=
require
(
"request"
);
var
options
=
{
method
:
'GET'
,
url
:
'https://v3.football.api-sports.io/standings'
,
qs
:
{
season
:
season
},
qs
:
{
league
:
leagueID
,
season
:
season
},
headers
:
{
'x-rapidapi-host'
:
'v3.football.api-sports.io'
,
'x-rapidapi-key'
:
'526fc70a2e8b315e9a960ac4b4764191'
...
...
@@ -31,6 +31,14 @@ function GetTeamStanding(season){
request
(
options
,
function
(
error
,
response
,
body
)
{
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
body
);
let
jsonBody
=
JSON
.
parse
(
body
);
console
.
log
(
jsonBody
);
console
.
log
(
jsonBody
.
response
[
0
]);
console
.
log
(
jsonBody
.
response
[
0
].
league
);
for
(
var
i
=
0
;
i
<
20
;
i
++
){
console
.
log
(
jsonBody
.
response
[
0
].
league
.
standings
[
0
][
i
].
rank
+
"|"
+
jsonBody
.
response
[
0
].
league
.
standings
[
0
][
i
].
team
.
name
);
}
});
}
...
...
@@ -123,3 +131,5 @@ function GetTeamStanding(teamID, season){
console
.
log
(
body
);
});
}
GetLeagueStanding
(
39
,
2021
);
...
...
Please
register
or
login
to post a comment