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-03 03:34:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b5f6d9de125c568366037c395421915d66a952ff
b5f6d9de
1 parent
fcd25754
Update print message
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
MovieList.js
MovieList.js
View file @
b5f6d9d
...
...
@@ -10,7 +10,6 @@ const KOFIC_KEY = config.KOFIC_KEY;
//=============================================================
export
function
MovieInfo
(
replyToken
,
message
)
{
request
.
get
(
{
url
:
KOFIC_URL
+
`?key=
${
KOFIC_KEY
}
&movieCd=
${
message
}
`
,
...
...
@@ -19,6 +18,21 @@ export function MovieInfo(replyToken, message) {
if
(
!
error
&&
response
.
statusCode
==
200
)
{
console
.
log
(
body
.
movieInfoResult
);
var
MovieInfo
=
body
.
movieInfoResult
.
movieInfo
;
var
MovieName
=
MovieInfo
.
movieNm
;
var
MovieDate
=
`
${
MovieInfo
.
openDt
.
slice
(
0
,
4
)}
년
${
MovieInfo
.
openDt
.
slice
(
4
,
6
)}
월
${
MovieInfo
.
openDt
.
slice
(
6
,
8
)}
일`
;
var
MovieTime
=
MovieInfo
.
showTm
;
var
MovieGenres
=
[];
for
(
var
i
in
MovieInfo
.
genres
)
{
MovieGenres
.
push
(
MovieInfo
.
genres
[
i
].
genreNm
);
}
var
MovieDirec
=
MovieInfo
.
directors
[
0
].
peopleNm
;
var
MovieActors
=
[];
for
(
var
i
=
0
;
i
<
MovieInfo
.
actors
.
length
&&
i
<
5
;
i
++
)
{
MovieActors
[
i
]
=
MovieInfo
.
actors
[
i
].
peopleNm
;
}
request
.
post
(
{
url
:
TARGET_URL
,
...
...
@@ -30,7 +44,7 @@ export function MovieInfo(replyToken, message) {
"messages"
:[
{
"type"
:
"text"
,
"text"
:
`영화명:
${
Movie
Info
.
movieNm
}
\n개봉날짜:
${
MovieInfo
.
prdtYear
}
\n상영시간:
${
MovieInfo
.
showTm
}
분\n장르:
${
MovieInfo
.
genres
[
0
].
genreNm
}
\n감독:
${
MovieInfo
.
directors
[
0
].
peopleNm
}
\n출연배우:
${
MovieInfo
.
actors
[
0
].
peopleNm
}
,
${
MovieInfo
.
actors
[
1
].
peopleNm
}
,
${
MovieInfo
.
actors
[
2
].
peopleNm
}
,
${
MovieInfo
.
actors
[
3
].
peopleNm
}
`
"text"
:
`영화명:
${
Movie
Name
}
\n개봉날짜:
${
MovieDate
}
\n상영시간:
${
MovieTime
}
분\n장르:
${
MovieGenres
}
\n감독:
${
MovieDirec
}
\n출연배우:
${
MovieActors
}
`
}
]
}
...
...
Please
register
or
login
to post a comment