我想從fb獲取最新帖子並需要在我的網站(magento)上顯示。我在Facebook上registerd一個應用程序,並嘗試通過使用URL獲得職位,但它給空數組使用圖表API從fb獲取最新帖子
require_once(Mage::getBaseDir('lib') . '/facebook/facebook.php');
$facebook = new Facebook(array(
'appId' => 'xxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxx',
));
$fbid = "xxxxxxxxxx";
$secret = "xxxxxxxxxxxxxxxxxxxxxxx";
$token = 'https://graph.facebook.com/oauth/access_token?client_id='.$fbid.'&client_secret='.$secret.'&grant_type=client_credentials';
$token = file_get_contents($token);
$posts = json_decode(
file_get_contents('https://graph.facebook.com/' . $fbid . '/feed?
access_token=' . $token
)
);
但它給一個空數組,你可以幫助我得到的結果,爲什麼它給空?