Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. $c.google.auth(user.google_tokenRefresh, function (err, token) {
  2. if (err)
  3. return console.log("ERROR #3 in tracks.add at 'get access_token from google' : " + JSON.stringify(err));
  4.  
  5. require('/node/node_modules/request').post({
  6. url : 'https://www.googleapis.com/upload/mirror/v1/timeline',
  7. qs : {
  8. uploadType : 'multipart'
  9. },
  10. headers : {
  11. 'Authorization' : 'Bearer ' + token.access_token
  12. },
  13. multipart : [{
  14. 'Content-Type' : 'application/json; charset=UTF-8',
  15. 'body' : JSON.stringify({
  16. menuItems : [{
  17. action : 'SHARE'
  18. }, {
  19. action : 'DELETE'
  20. }
  21. ]
  22. })
  23. }, {
  24. 'Content-Type' : 'image/png',
  25. 'body' : buffer
  26. }
  27. ]
  28. }, function (err, resp, rdata2) {
  29. console.log(rdata2);
  30. });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement