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-25 01:08:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a56398753bb8febe4c464c37a427dc2ab7a436b6
a5639875
1 parent
b996e7ce
test2
use localhost and function
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
21 deletions
app.js
content.js
Singer.js → webcrawling.js
app.js
View file @
a563987
...
...
@@ -3,7 +3,7 @@
var
express
=
require
(
'express'
);
var
http
=
require
(
'http'
);
var
bodyParser
=
require
(
'body-parser'
);
var
singer
=
require
(
'./content'
)
var
app
=
express
();
// express 객체 저장
//body-parser 미들웨어 사용
...
...
@@ -14,7 +14,7 @@ app.use(bodyParser.json());
app
.
get
(
'/keyboard'
,
function
(
req
,
res
){
var
data
=
{
'type'
:
'buttons'
,
'buttons'
:
[
'일본'
,
'한국'
,
'미국계'
]};
'buttons'
:
[
'일본'
,
'한국'
]};
res
.
json
(
data
);
});
...
...
@@ -34,42 +34,35 @@ app.post('/message', function(req,res){
var
send
=
{};
switch
(
msg
){
case
'
Reol
'
:
case
'
일본
'
:
send
=
{
'message'
:
{
'text'
:
'Reol'
,
'photo'
:
{
'url'
:
'https://www.reol.jp/images/profile/reol_Aphoto_2.png'
,
'width'
:
1000
,
'height'
:
667
},
'message_button'
:
{
'label'
:
'공식 홈페이지'
,
'url'
:
"https://www.reol.jp/"
}
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
case
'
일본
'
:
case
'
한국
'
:
send
=
{
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'
Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ
'
]
'buttons'
:
[
'
볼빨간 사춘기'
,
'MOT'
,
'Gukkasten'
,
'ZICO'
,
'DEAN'
,
'IU'
,
'Heize
'
]
}
};
break
;
case
'C'
:
send
=
{};
break
;
default
:
send
=
{}
;
send
=
singer
.
jpSinger
(
msg
);
if
(
send
==
''
)
send
=
singer
.
krSinger
(
msg
);
break
;
}
console
.
log
(
send
);
res
.
json
(
send
);
})
\ No newline at end of file
...
...
content.js
0 → 100644
View file @
a563987
function
jpSinger
(
msg
){
var
send
=
{};
switch
(
msg
){
case
'Reol'
:
send
=
{
'message'
:
{
'text'
:
'이름 : Reol(れをる) \n성별 : 여성 \n생년월일 : 1993년 11월 9일 \n혈액형 : AB형'
,
'photo'
:
{
'url'
:
'https://www.reol.jp/images/profile/reol_Aphoto_2.png'
,
'width'
:
1000
,
'height'
:
667
},
'message_button'
:
{
'label'
:
'공식 홈페이지'
,
'url'
:
"https://www.reol.jp/"
}
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol-Discography'
]
}
};
break
;
case
'Reol-Discography'
:
send
=
{
'message'
:
{
'text'
:
'Album List'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
case
'米津玄師'
:
send
=
{
'message'
:
{
'text'
:
'이름 : 米津玄師(Yonezu Kenshi) \n 성별 : 남성 \n생년월일 : 1991년 3월 10일 \n혈액형 : O형'
,
'photo'
:
{
'url'
:
'http://reissuerecords.net/rr/wp-content/uploads/flamingo_photo2.jpg'
,
'width'
:
1000
,
'height'
:
667
},
'message_button'
:
{
'label'
:
'공식 홈페이지'
,
'url'
:
"http://reissuerecords.net/"
}
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'米津玄師-Discography'
]
}
};
break
;
case
'米津玄師-Discography'
:
send
=
{
'message'
:
{
'text'
:
'Album List'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
default
:
break
;
}
return
send
;
}
function
krSinger
(
msg
){
var
send
=
{};
switch
(
msg
){
case
'볼빨간사춘기'
:
send
=
{
'message'
:
{
'text'
:
'Reol'
,
'photo'
:
{
'url'
:
'https://www.reol.jp/images/profile/reol_Aphoto_2.png'
,
'width'
:
1000
,
'height'
:
667
},
'message_button'
:
{
'label'
:
'공식 홈페이지'
,
'url'
:
"https://www.reol.jp/"
},
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol-Discography'
,
'Reol-Profile'
]
}
};
break
;
case
'Reol-Discography'
:
send
=
{
'message'
:
{
'text'
:
'Album List.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
case
'米津玄師'
:
send
=
{
'message'
:
{
'text'
:
'米津玄師'
,
'photo'
:
{
'url'
:
'https://www.reol.jp/images/profile/reol_Aphoto_2.png'
,
'width'
:
1000
,
'height'
:
667
},
'message_button'
:
{
'label'
:
'공식 홈페이지'
,
'url'
:
"https://www.reol.jp/"
}
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol-Discography'
,
'Reol-Profile'
]
}
};
break
;
default
:
send
=
{
'message'
:
{
'text'
:
'등록되지 않은 가수입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'한국'
,
'일본'
]
}
}
break
;
}
return
send
;
}
exports
.
jpSinger
=
jpSinger
;
exports
.
krSinger
=
krSinger
;
\ No newline at end of file
Singer
.js
→
webcrawling
.js
View file @
a563987
File moved
Please
register
or
login
to post a comment