Toggle navigation
Toggle navigation
This project
Loading...
Sign in
백승욱
/
movie-reco-chatbot
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-06 17:42:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4e2291763df1e6753f3d019ca8a5b3baef9c37f3
4e229176
1 parent
eddd2e42
Add moviecode information
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
MovieRecommend.js
MovieRecommend.js
View file @
4e22917
...
...
@@ -41,7 +41,7 @@ function weekendBoxOfficeMovie() {
}
//Returns the title, year of release, names of directors and actors.
//The return format is array and index is as follows:
//[title, year of release, director, actor1, actor2]
//[title, year of release, director, actor1, actor2
, moviecode
]
async
function
movieinfo
(
message
){
moviecdlist
=
await
weekendBoxOfficeMovie
();
...
...
@@ -77,9 +77,10 @@ async function movieinfo(message){
var
actor_1
=
body
.
movieInfoResult
.
movieInfo
.
actors
[
0
].
peopleNm
var
actor_2
=
body
.
movieInfoResult
.
movieInfo
.
actors
[
1
].
peopleNm
}
movieresult
.
push
([
title
,
openyear
,
director
,
actor_1
,
actor_2
])
var
moviecode_rc
=
body
.
movieInfoResult
.
movieInfo
.
movieCd
movieresult
.
push
([
title
,
openyear
,
director
,
actor_1
,
actor_2
,
moviecode_rc
])
}
//제목, 개봉년도, 감독, 배우1, 배우2
}
//제목, 개봉년도, 감독, 배우1, 배우2
, 영화코드
}
resolve
(
movieresult
);
}
...
...
@@ -89,7 +90,7 @@ async function movieinfo(message){
}
//Enter a movie genre in the message variable.
//It will then return movie title, year of release, director
and actor
information to Line Messenger.
//It will then return movie title, year of release, director
, actor and moviecode
information to Line Messenger.
exports
.
movieRecommend
=
async
function
(
replyToken
,
message
){
var
movieresult
=
[];
while
(
1
){
...
...
@@ -103,7 +104,7 @@ exports.movieRecommend = async function(replyToken, message){
}
var
movierecommend_output
=
''
;
for
(
let
i
=
0
;
i
<
movieresult
.
length
;
i
++
){
movierecommend_output
+=
`제목:
${
movieresult
[
i
][
0
]}
(
${
movieresult
[
i
][
1
]}
)\n감독:
${
movieresult
[
i
][
2
]}
\n배우:
${
movieresult
[
i
][
3
]}
,
${
movieresult
[
i
][
4
]}
\n`
movierecommend_output
+=
`제목:
${
movieresult
[
i
][
0
]}
(
${
movieresult
[
i
][
1
]}
)\n감독:
${
movieresult
[
i
][
2
]}
\n배우:
${
movieresult
[
i
][
3
]}
,
${
movieresult
[
i
][
4
]}
\n
영화코드:
${
movieresult
[
i
][
5
]}
`
}
request
.
post
(
{
...
...
Please
register
or
login
to post a comment