-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test 1 - fail. Looks like the google-vision-api-client has outdated U…
…RLs for the API
- Loading branch information
Jugal
committed
Mar 6, 2016
1 parent
beb8ab0
commit 3ce503d
Showing
4 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules/ | ||
.env | ||
jugalshahx-a726a24b46ff.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require('dotenv').config(); | ||
var vision = require('google-vision-api-client'); | ||
var requtil = vision.requtil; | ||
|
||
//Prepare your service account from trust preview certificated project | ||
var jsonfile = process.env.credFile; //'/path-to-your-service-account.json'; | ||
|
||
//Initialize the api | ||
vision.init(jsonfile); | ||
|
||
//Build the request payloads | ||
var d = requtil.createRequests().addRequest( | ||
requtil.createRequest('testpic.bmp') | ||
.withFeature('TEXT_DETECTION', 10) | ||
.build()); | ||
|
||
//Do query to the api server | ||
vision.query(d, function(e, r, d){ | ||
if(e) console.log('ERROR:', e); | ||
console.log(JSON.stringify(d)); | ||
}); |
Binary file not shown.