Skip to content

Commit

Permalink
Test 1 - fail. Looks like the google-vision-api-client has outdated U…
Browse files Browse the repository at this point in the history
…RLs for the API
  • Loading branch information
Jugal committed Mar 6, 2016
1 parent beb8ab0 commit 3ce503d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
.env
jugalshahx-a726a24b46ff.json
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"homepage": "https://github.com/jugaltheshah/visionapitest#readme",
"dependencies": {
"dotenv": "^2.0.0",
"google-vision-api-client": "0.0.2"
}
}
21 changes: 21 additions & 0 deletions test.js
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 added testpic.bmp
Binary file not shown.

0 comments on commit 3ce503d

Please sign in to comment.