Closed josser closed 12 years ago
Hi, here the example:
fbgraph.setAccessToken(object._user.auth.facebook.access_token);
fbgraph.post( "/me/feed", { message: 'Someone commented your post: ' + object.comments[0].message, privacy: { value: 'CUSTOM', friends: 'SELF' } }, function(err, res){ if (err) { console.log(err); } });
I see message on the wall but privacy settings doesn't applied.
I made some investigation and found that problem is in querystring:
Graph.prototype.post = function() { var self = this , postData = querystring.stringify(this.postData); // Querystring don't like nested objects. this.options.body = postData;
Here REPL session example:
t = {message: "123", smth: { subprop: "123"}}; { message: '123', smth: { subprop: '123' } } qs = require("querystring"); { unescapeBuffer: [Function], unescape: [Function], escape: [Function], encode: [Function], stringify: [Function], decode: [Function], parse: [Function] } qs.stringify(t) 'message=123&smth='
Here the issue (I'm curious why it closed): https://github.com/joyent/node/issues/1665
Oh, cool, cool! Can you please publish this new version to npm? :) Thanks!
All set!
Hi, here the example:
fbgraph.setAccessToken(object._user.auth.facebook.access_token);
fbgraph.post( "/me/feed", { message: 'Someone commented your post: ' + object.comments[0].message, privacy: { value: 'CUSTOM', friends: 'SELF' } }, function(err, res){ if (err) { console.log(err); } });
I see message on the wall but privacy settings doesn't applied.
I made some investigation and found that problem is in querystring:
Graph.prototype.post = function() { var self = this , postData = querystring.stringify(this.postData); // Querystring don't like nested objects. this.options.body = postData;
Here REPL session example:
Here the issue (I'm curious why it closed): https://github.com/joyent/node/issues/1665