node.jsを使用してFacebookAPIバッチリクエストを送信するにはどうすればよいですか?
FBの例は機能しません。
しかし、私はついにdanwong/restler.jsを次のように機能させることができました。
exports.updateUserFriends = function (userData, next) {
var TOKEN = userData[1];
var fbID = userData[3].id;
var batchreq = {};
batchreq.batch = [];
batchreq.batch.push({"method":"GET", "relative_url":fbID+"/"});
batchreq.batch.push({"method": "GET", "relative_url":fbID+"/friends?limit=50"});
restler.post('https://graph.facebook.com?access_token='+TOKEN,
{data:"batch="+JSON.stringify(batchreq.batch)})
.on('complete', function(data) {
console.log(data);
return next;
});
};
だから私は他の誰かの少しの欲求不満を救うためにこれを投稿すると思いました。