Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Chat_Bot
/
KaKao_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤준현
2018-11-26 21:35:33 +0900
1
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6da2ca55b696f589aecf084a1319c295ccaf2692
6da2ca55
1 parent
4536b099
Notcallbackver
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
30 deletions
app.js
content.js
app.js
View file @
6da2ca5
...
...
@@ -26,55 +26,42 @@ http.createServer(app).listen(8080, () => {
// http://서버주소/message
app
.
post
(
'/message'
,
function
(
req
,
res
)
{
app
.
post
(
'/message'
,
function
(
req
,
res
)
{
//유저가 입력한 데이터
var
msg
=
req
.
body
.
content
;
console
.
log
(
'전달받은 메시지 : '
+
msg
);
var
send
=
{};
function
hell_callback
(
msg
,
callback
){
switch
(
msg
){
case
'일본'
:
switch
(
msg
)
{
case
'일본'
:
send
=
{
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
case
'한국'
:
case
'한국'
:
send
=
{
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'볼빨간 사춘기'
,
'MOT'
,
'Gukkasten'
,
'ZICO'
,
'DEAN'
,
'IU'
,
'Heize'
]
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'볼빨간 사춘기'
,
'MOT'
,
'Gukkasten'
,
'ZICO'
,
'DEAN'
,
'IU'
,
'Heize'
]
}
};
break
;
default
:
send
=
singer
.
jpSinger
(
msg
)
var
album_info
=
[];
var
album
;
console
.
log
(
discography
[
0
].
json_album
[
1
]);
for
(
var
i
=
0
;
i
<
discography
[
0
].
json_album
.
lenth
;
i
++
)
{
album
=
discography
[
0
].
json_album
[
i
]
+
' 발매일 : '
+
discography
[
0
].
json_year
[
i
];
console
.
log
(
album
);
}
});
if
(
send
==
''
)
if
(
send
==
''
)
send
=
singer
.
krSinger
(
msg
);
break
;
}
callback
(
send
);
}
console
.
log
(
send
);
hell_callback
(
msg
,
function
(
hell_send
){
res
.
json
(
hell_send
);
})
})
\ No newline at end of file
...
...
content.js
View file @
6da2ca5
var
webcrawl
=
require
(
'./crawling/Reol'
)
function
jpSinger
(
msg
,
callback
){
function
jpSinger
(
msg
){
var
send
=
{};
switch
(
msg
){
case
'Reol'
:
...
...
@@ -25,7 +25,7 @@ function jpSinger(msg,callback){
break
;
case
'Reol-Discography'
:
webcrawl
.
crawl_Reol
(
'https://namu.wiki/w/%EB%A0%88%EC%98%A4%EB%A3%A8/%EC%9D%8C%EB%B0%98#toc'
,
function
(
discography
){
callback
(
discography
)
});
break
;
case
'米津玄師'
:
...
...
윤준현
@2015104193
2018-12-04 12:21:30 UTC
Mentioned in commit
1efb470b
Please
register
or
login
to post a comment