what I need is to on my server-side(Node.js), make something like this:
$.when(
$.get("https://graph.facebook.com/341446932600922/posts?fields=message,created_time&limit=2", function (dataAcib) {
allPosts.acib = dataAcib.data;
}),
$.get("https://graph.facebook.com/599914540070454/posts?fields=message,created_time&limit=2", function (dataBlusoft) {
allPosts.blusoft = dataBlusoft.data;
})
).then(function () {
$.each(allPosts, function () {
for (i = 0; i < this.length; i++)
{
$("#divNoticias").append("<p>" + this[0].message + "</p>");
}
//- console.log(this[0].message);
});
console.log(allPosts);
var posts = $.makeArray(allPosts.data);
console.log(posts);
});
I want to accomplish this on server side so that I can send the result to my client-side.
I've used Requestify, and succeded on getting the data of ONE request, but I want to do all my requests (total of 6) assynchronously and when they are finished, procced to the callback.
How can I make all those GET calls and when ALL they are done, do a callback on node server-side?
Thanks