Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
LINEBOT
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
은승우
2019-12-05 18:03:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ee3c48bb080ab5e88ad3ae015bd22b23081733ea
ee3c48bb
1 parent
10eb592b
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
app.js
app.js
View file @
ee3c48b
...
...
@@ -88,12 +88,8 @@ async function handleEvent(event) {
.
then
(
async
(
stream
)
=>
{
await
stream
.
on
(
'data'
,
(
chunk
)
=>
{
file
=
chunk
;
console
.
log
(
chunk
);
});
}
);
console
.
log
(
file
);
fs
.
writeFileSync
(
'./photo/1.png'
,
chunk
);
console
.
log
(
file
);
var
cheerio
=
require
(
'cheerio'
);
var
uriBase
=
'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'
;
var
options
=
{
...
...
@@ -106,7 +102,7 @@ async function handleEvent(event) {
'Content-Type'
:
'application/json'
,
'Ocp-Apim-Subscription-Key'
:
'979dc5d63344438fa4701c62feebb7dc'
},
body
:
f
ile
body
:
f
s
.
readFileSync
(
'./photo/1.png'
)
};
console
.
log
(
options
.
body
);
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
...
...
@@ -143,6 +139,10 @@ async function handleEvent(event) {
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
});
});
}
);
});
}
...
...
Please
register
or
login
to post a comment