Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이종상
/
OSS-2021-Project2015
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
이종상
2021-06-20 18:16:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f43f186fe8f701c23deb34e9464a2ec8bc7362ca
f43f186f
1 parent
ebd1dd5a
final updated
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
66 deletions
Project/app.js
Project/app.js
View file @
f43f186
...
...
@@ -26,7 +26,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
물말은밥에
김치"
,
"name"
:
"
열무
김치"
,
"country"
:
"한식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -34,7 +34,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
고깃
국"
,
"name"
:
"
미역
국"
,
"country"
:
"한식"
,
"spicy"
:
"no"
,
"cold"
:
"hot"
...
...
@@ -50,7 +50,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
만토우
"
,
"name"
:
"
김치만두
"
,
"country"
:
"중식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -58,7 +58,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
로뽀카오
"
,
"name"
:
"
냉짬뽕
"
,
"country"
:
"중식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -66,7 +66,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
샤오빙
"
,
"name"
:
"
물만두
"
,
"country"
:
"중식"
,
"spicy"
:
"no"
,
"cold"
:
"hot"
...
...
@@ -74,7 +74,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
또장
"
,
"name"
:
"
녹차
"
,
"country"
:
"중식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
...
...
@@ -90,7 +90,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
양상추절임
"
,
"name"
:
"
냉우동
"
,
"country"
:
"일식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -106,7 +106,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
생선구이
"
,
"name"
:
"
모찌
"
,
"country"
:
"일식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
...
...
@@ -114,7 +114,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
매콤텐네
파스타"
,
"name"
:
"파스타"
,
"country"
:
"양식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -122,7 +122,7 @@ var foodArray = [
{
"meal"
:
"morning"
,
"name"
:
"
토마토마리네이드
"
,
"name"
:
"
냉파스타
"
,
"country"
:
"양식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -144,10 +144,9 @@ var foodArray = [
"cold"
:
"cold"
},
/////////////////////////////점심////////////////
{
"meal"
:
"lunch"
,
"name"
:
"순두부
찌개
"
,
"name"
:
"순두부"
,
"country"
:
"한식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -187,7 +186,7 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
홈쇼두부
"
,
"name"
:
"
중국냉면
"
,
"country"
:
"중식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -211,7 +210,7 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
우동
"
,
"name"
:
"
매운라멘
"
,
"country"
:
"일식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -219,7 +218,7 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
탄탄면
"
,
"name"
:
"
매운모밀
"
,
"country"
:
"일식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -243,7 +242,7 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
비프
스튜"
,
"name"
:
"스튜"
,
"country"
:
"양식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -251,7 +250,7 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
스시
"
,
"name"
:
"
샌드위치
"
,
"country"
:
"양식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -259,23 +258,20 @@ var foodArray = [
{
"meal"
:
"lunch"
,
"name"
:
"
브라운스톡
"
,
"name"
:
"
알리오올리오
"
,
"country"
:
"양식"
,
"spicy"
:
"
hot
"
,
"cold"
:
"
cold
"
"spicy"
:
"
no
"
,
"cold"
:
"
hot
"
},
{
"meal"
:
"lunch"
,
"name"
:
"
BLT
"
,
"name"
:
"
오믈렛
"
,
"country"
:
"양식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
},
//////////////////////////////저녁////////////////////
{
"meal"
:
"dinner"
,
"name"
:
"닭갈비"
,
...
...
@@ -302,7 +298,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
나물
밥"
,
"name"
:
"
곤드레
밥"
,
"country"
:
"한식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
...
...
@@ -334,7 +330,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
바바오차이
"
,
"name"
:
"
꽃빵
"
,
"country"
:
"중식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
...
...
@@ -342,7 +338,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
게키카
라멘"
,
"name"
:
"라멘"
,
"country"
:
"일식"
,
"spicy"
:
"yes"
,
"cold"
:
"hot"
...
...
@@ -350,7 +346,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
히야시츄카
"
,
"name"
:
"
불초밥
"
,
"country"
:
"일식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -358,7 +354,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
덴푸라
"
,
"name"
:
"
튀김
"
,
"country"
:
"일식"
,
"spicy"
:
"no"
,
"cold"
:
"hot"
...
...
@@ -366,7 +362,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
가포아키
"
,
"name"
:
"
초밥
"
,
"country"
:
"일식"
,
"spicy"
:
"no"
,
"cold"
:
"cold"
...
...
@@ -382,7 +378,7 @@ var foodArray = [
{
"meal"
:
"dinner"
,
"name"
:
"
이탈리아 고추 볶음
"
,
"name"
:
"
해물 파스타
"
,
"country"
:
"양식"
,
"spicy"
:
"yes"
,
"cold"
:
"cold"
...
...
@@ -576,41 +572,87 @@ https://developers.naver.com/docs/search/local/
console
.
log
(
json
);
console
.
log
(
json
[
'items'
][
1
][
'link'
]);
tempstring
=
json
[
'items'
][
1
][
'link'
];
console
.
log
(
tempstring
);
request
.
post
(
{
url
:
TARGET_URL
,
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
name
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
"드셔보세요!"
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
json
[
'items'
][
1
][
'link'
]
// 링크 발송
},
{
"type"
:
"text"
,
"text"
:
"이런 음식점은 어떠세요?"
}
]
}
},(
error
,
response
,
body
)
=>
{
console
.
log
(
body
)
}
);
if
(
json
[
'items'
][
1
][
'link'
]
!=
''
)
{
console
.
log
(
tempstring
);
request
.
post
(
{
url
:
TARGET_URL
,
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
name
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
"드셔보세요!"
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
json
[
'items'
][
1
][
'link'
]
// 링크 발송
},
{
"type"
:
"text"
,
"text"
:
"이런 음식점은 어떠세요?"
}
]
}
},(
error
,
response
,
body
)
=>
{
console
.
log
(
body
)
}
);
}
else
{
console
.
log
(
tempstring
);
request
.
post
(
{
url
:
TARGET_URL
,
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
name
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
"드셔보세요!"
// 결과 도출
},
{
"type"
:
"text"
,
"text"
:
json
[
'items'
][
1
][
'title'
]
// 링크 발송
},
{
"type"
:
"text"
,
"text"
:
"이런 음식점은 어떠세요?"
},
{
"type"
:
"text"
,
"text"
:
"이 식당은 링크가 없어요!"
}
]
}
},(
error
,
response
,
body
)
=>
{
console
.
log
(
body
)
}
);
}
})
...
...
Please
register
or
login
to post a comment