Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $c.google.auth(user.google_tokenRefresh, function (err, token) {
- if (err)
- return console.log("ERROR #3 in tracks.add at 'get access_token from google' : " + JSON.stringify(err));
- require('/node/node_modules/request').post({
- url : 'https://www.googleapis.com/upload/mirror/v1/timeline',
- qs : {
- uploadType : 'multipart'
- },
- headers : {
- 'Authorization' : 'Bearer ' + token.access_token
- },
- multipart : [{
- 'Content-Type' : 'application/json; charset=UTF-8',
- 'body' : JSON.stringify({
- menuItems : [{
- action : 'SHARE'
- }, {
- action : 'DELETE'
- }
- ]
- })
- }, {
- 'Content-Type' : 'image/png',
- 'body' : buffer
- }
- ]
- }, function (err, resp, rdata2) {
- console.log(rdata2);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement