อันนี้ใช้ได้ปกติ แต่ผมอยากเพิ่มให้มัน ดึงข้อมูลได้หลาย ID มากขึ้น
privateObj.callFB = function(newConfig){
FB.api("/"+newConfig.pagename, {
access_token : newConfig.token,
"fields" :"picture{url},name,cover,fan_count,link,posts.limit("+newConfig.feedlimit+"){attachments, likes.limit(0).summary(true), message, created_time, link}"
},
function (response) {
if (!response.error) {
newConfig.onLoad(privateObj.formatResponse[newConfig.format](response, newConfig), newConfig.format, response);
} else {
newConfig.onLoad(response.error, 'json');
}
}
);
};
ผมเลยปรับไปเป็น ids ดังนี้ครับ แต่มันไม่ทรายสามารถใช้งานได้ครับ รบกวนพี่ ๆ หน่อยนะครับ
privateObj.callFB = function(newConfig){
FB.api("/",{
access_token : newConfig.token,
"ids" : +newConfig.pagename,
"fields" :"picture{url},name,cover,fan_count,link,posts.limit("+newConfig.feedlimit+"){attachments, likes.limit(0).summary(true), message, created_time, link}"
},
function (response) {
if (!response.error) {
newConfig.onLoad(privateObj.formatResponse[newConfig.format](response, newConfig), newConfig.format, response);
} else {
newConfig.onLoad(response.error, 'json');
}
}
);
};