박찬수

commit

...@@ -28,7 +28,7 @@ app.post('/hook', function (req, res) { ...@@ -28,7 +28,7 @@ app.post('/hook', function (req, res) {
28 console.log('[request message]', eventObj.message); 28 console.log('[request message]', eventObj.message);
29 console.log("Receive Message : ", eventObj.message.text); 29 console.log("Receive Message : ", eventObj.message.text);
30 30
31 - //console.log(soccer.GetPlayerInfo(276, 2019)); 31 + console.log(soccer.GetPlayerInfo(276, 2019));
32 32
33 request.post( 33 request.post(
34 { 34 {
......
...@@ -15,10 +15,9 @@ request(options, function (error, response) { ...@@ -15,10 +15,9 @@ request(options, function (error, response) {
15 console.log(response.body); 15 console.log(response.body);
16 }); 16 });
17 17
18 -module.exports = function(){ 18 +module.exports = {
19 - this.GetPlayerInfo = function(playerID, season){ 19 + GetPlayerInfo : function(playerID, season){
20 var request = require('request'); 20 var request = require('request');
21 -
22 var options = { 21 var options = {
23 method: 'GET', 22 method: 'GET',
24 url: 'https://v3.football.api-sports.io/players', 23 url: 'https://v3.football.api-sports.io/players',
...@@ -28,12 +27,9 @@ module.exports = function(){ ...@@ -28,12 +27,9 @@ module.exports = function(){
28 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191' 27 'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191'
29 } 28 }
30 }; 29 };
31 -
32 request(options, function (error, response) { 30 request(options, function (error, response) {
33 if (error) throw new Error(error); 31 if (error) throw new Error(error);
34 console.log(response.body); 32 console.log(response.body);
35 -
36 - return response.body;
37 }); 33 });
38 } 34 }
39 } 35 }
...\ No newline at end of file ...\ No newline at end of file
......