percolatestudio / meteor-google-api

A simple API encapsulating some common patterns regarding Google's APIs
https://atmospherejs.com/percolate/google-api
MIT License
48 stars 30 forks source link

Upload to youtube using v3 #14

Closed gabrielstuff closed 9 years ago

gabrielstuff commented 9 years ago

Hello,

For one of my project I use this snippet which works perfect :

var uploadYoutube = function(mediaString) {
    var media = fs.createReadStream(mediaString);
    media.on('error', function(err){
      console.log('err: ', err);
    });

    yt = googleapis.youtube('v3');
    yt.videos.insert({
      part: 'status,snippet',
      resource: {
        snippet: {
          title: 'foo',
          description: 'bar'
        },
        status: {
          privacyStatus: 'private' //if you want the video to be private
        }
      },
      media: {
        body: media
      }
    }, function(error, data) {
      if (error) {
        console.log(error);
      } else {
        console.log(data);
      }
    });
  }

As you can see, I make use of the googleapi nodejs lib. How would you do the same with meteor-google-api ?

Thanks

tmeasday commented 9 years ago

Hey,

This library is simply to make REST API calls against various google libs and ties in with the accounts-google package to do the right thing with offline tokens and access tokens. It doesn't make any attempt to work with the various node APIs to do more complex things.

Potentially you could borrow some ideas from this package to wrap the node APIs in a accounts-google aware layer? But that would probably have to be done on a lib-by-lib basis.