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-04 21:09:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51fd34f33a8607d03d3ff45329813d860250fc80
51fd34f3
1 parent
f68b645d
import commit
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
reply.js
soccer.js
reply.js
View file @
51fd34f
...
...
@@ -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
,
...
...
soccer.js
View file @
51fd34f
...
...
@@ -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
...
...
Please
register
or
login
to post a comment