Ga Min Cha

Jsonparsing Added

...@@ -16,7 +16,7 @@ function GetGameSchedule(teamID, leagueID, season, eventObj){ ...@@ -16,7 +16,7 @@ function GetGameSchedule(teamID, leagueID, season, eventObj){
16 }); 16 });
17 } 17 }
18 18
19 -// 입력: 리그ID, 반환: 팀 순위 19 +// 입력: 리그ID, 시즌(*필수) 반환: 팀 순위
20 function GetLeagueStanding(leagueID, season){ 20 function GetLeagueStanding(leagueID, season){
21 var request = require("request"); 21 var request = require("request");
22 var options = { 22 var options = {
...@@ -42,13 +42,13 @@ function GetLeagueStanding(leagueID, season){ ...@@ -42,13 +42,13 @@ function GetLeagueStanding(leagueID, season){
42 }); 42 });
43 } 43 }
44 44
45 -// 입력: 리그ID, 반환: (선수) 득점 순위 45 +// 입력: 리그ID(*필수), 시즌(*필수), 반환: (선수) 득점 순위
46 -function GetTopScorer(season){ 46 +function GetTopScorer(leagueID, season){
47 var request = require("request"); 47 var request = require("request");
48 var options = { 48 var options = {
49 method: 'GET', 49 method: 'GET',
50 url: 'https://v3.football.api-sports.io/players/topscorers', 50 url: 'https://v3.football.api-sports.io/players/topscorers',
51 - qs: {season: season}, 51 + qs: {league : leagueID, season: season},
52 headers: { 52 headers: {
53 'x-rapidapi-host': 'v3.football.api-sports.io', 53 'x-rapidapi-host': 'v3.football.api-sports.io',
54 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191' 54 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191'
...@@ -60,13 +60,13 @@ function GetTopScorer(season){ ...@@ -60,13 +60,13 @@ function GetTopScorer(season){
60 }); 60 });
61 } 61 }
62 62
63 -// 입력: 리그ID, 반환: 도움 순위 63 +// 입력: 리그ID(*필수), 시즌(*필수), 반환: 도움 순위
64 -function GetTopAssist(season){ 64 +function GetTopAssist(leagueID, season){
65 var request = require("request"); 65 var request = require("request");
66 var options = { 66 var options = {
67 method: 'GET', 67 method: 'GET',
68 url: 'https://v3.football.api-sports.io/players/topassists', 68 url: 'https://v3.football.api-sports.io/players/topassists',
69 - qs: {season: season}, 69 + qs: {league : leagueID, season: season},
70 headers: { 70 headers: {
71 'x-rapidapi-host': 'v3.football.api-sports.io', 71 'x-rapidapi-host': 'v3.football.api-sports.io',
72 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191' 72 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191'
...@@ -132,4 +132,3 @@ function GetTeamStanding(teamID, season){ ...@@ -132,4 +132,3 @@ function GetTeamStanding(teamID, season){
132 }); 132 });
133 } 133 }
134 134
135 -GetLeagueStanding(39, 2021);
......
This diff is collapsed. Click to expand it.
...@@ -33,10 +33,10 @@ function transMsg(replyMsg){ ...@@ -33,10 +33,10 @@ function transMsg(replyMsg){
33 console.log(transMessage); 33 console.log(transMessage);
34 } 34 }
35 }); 35 });
36 - } 36 +}
37 37
38 var replyMsg = "선수, 시즌, 순위, 리그, 손흥민, 네이마르, 1등" 38 var replyMsg = "선수, 시즌, 순위, 리그, 손흥민, 네이마르, 1등"
39 - 39 +
40 function transMsg_toEn(replyMsg){ 40 function transMsg_toEn(replyMsg){
41 var language = "en"; 41 var language = "en";
42 42
...@@ -56,4 +56,4 @@ function transMsg_toEn(replyMsg){ ...@@ -56,4 +56,4 @@ function transMsg_toEn(replyMsg){
56 console.log(transMessage); 56 console.log(transMessage);
57 } 57 }
58 }); 58 });
59 -}
...\ No newline at end of file ...\ No newline at end of file
59 +}
...\ No newline at end of file ...\ No newline at end of file
......