UNPKG

googleapis

Version:

Generates node client libs for Google APIs.

61 lines (42 loc) 2.07 kB
#node-googleapis ``node-googleapis`` allow you to generate client libs for [Google APIs](https://developers.google.com/apis-explorer/). ## Installation npm install googleapis ## Usage var googleapis = require('googleapis); googleapis.load('urlshortener','v1', function(err, client) { // set api key client.setApiKey('AIzaSyAdjHPT5Pb7Nu56WJ_nlrMGOAgUAtKjiPM'); // batch requests client .newBatchRequest() .add('urlshortener.url.get', { shortUrl: 'http://goo.gl/DdUKX' }) .add('urlshortener.url.insert', { longUrl: 'http://burcudogan.com' }) .execute(null, function(errs, results, headers){ }); // a single request client .newRequest('urlshortener.url.get', { shortUrl1: 'http://goo.gl/DdUKX' }) .execute(null, function(err, result, headers){ }); // request builders client.urlshortener.url .get({ shortUrl: 'http://goo.gl/DdUKX' }) .execute(); }); ## License Copyright (c) 2012 Burcu Dogan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.