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 14:07:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7600e0967b12cb8ba6eeb2a4650b57ad2ea2d325
7600e096
1 parent
a26c0d4f
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
app.js
app.js
View file @
7600e09
...
...
@@ -86,7 +86,8 @@ async function handleEvent(event) {
.
then
((
stream
)
=>
{
stream
.
on
(
'data'
,
(
chunk
)
=>
{
console
.
log
(
chunk
);
var
file
=
fs
.
createReadStream
(
chunk
);
console
.
log
(
file
);
var
cheerio
=
require
(
'cheerio'
);
var
uriBase
=
'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'
;
...
...
@@ -98,15 +99,14 @@ async function handleEvent(event) {
language
:
'en'
},
headers
:
{
'Content-Type'
:
'application/
json
'
,
'Content-Type'
:
'application/
octet-stream
'
,
'Ocp-Apim-Subscription-Key'
:
'979dc5d63344438fa4701c62feebb7dc'
},
body
:
chunk
};
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
let
jsonRes
=
JSON
.
stringify
(
JSON
.
parse
(
body
),
null
,
' '
);
console
.
log
(
jsonRes
);
var
text
=
''
;
while
(
data
.
indexOf
(
'text\\'
)
!=-
1
)
{
...
...
Please
register
or
login
to post a comment