박찬수

import commit

......@@ -9,6 +9,8 @@ const HTTPS = require('https');
const domain = "2018102191.osschatbot2022.tk"
const sslport = 23023;
var soccer = require('soccer.js');
const bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
......@@ -26,6 +28,8 @@ app.post('/hook', function (req, res) {
console.log('[request message]', eventObj.message);
console.log("Receive Message : ", eventObj.message.text);
console.log(soccer.GetPlayerInfo(33, 2019));
request.post(
{
url: TARGET_URL,
......
......@@ -13,4 +13,27 @@ var options = {
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
\ No newline at end of file
});
module.exports = function(){
this.GetPlayerInfo = function(playerID, season){
var request = require('request');
var options = {
method: 'GET',
url: 'https://v3.football.api-sports.io/players',
qs: {id: '276', season: '2019'},
headers: {
'x-rapidapi-host': 'v3.football.api-sports.io',
'x-rapidapi-key': '526fc70a2e8b315e9a960ac4b4764191'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
return response.body;
});
}
}
\ No newline at end of file
......