Php Facebook Feed:避免显示用户消息
Php Facebook Feed: avoid to display user messages
是否可以避免显示来自我的页面 Feed 的用户消息?
此处代码:
require 'inc/facebook.php';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
));
$fields = "id,message,picture,link,name,description,type,icon,created_time,from,object_id";
$fbApiGetPosts = $facebook->api('/' . $page_id . '/feed?limit=' . $limit . '&fields=' . $fields);
$getFb = array();
if (isset($fbApiGetPosts["data"]) && !empty($fbApiGetPosts["data"])) {
echo '<ul>';
foreach($fbApiGetPosts["data"] as $data)
{
echo '<li>' . substr($data['message'], 0, 140) . '</li>';
}
echo '</ul>';
}
/{page_id}/posts
端点仅显示页面自己的帖子(如果这是您的意思):
/{page-id}/posts
shows only the posts that were published by this page.
是否可以避免显示来自我的页面 Feed 的用户消息? 此处代码:
require 'inc/facebook.php';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
));
$fields = "id,message,picture,link,name,description,type,icon,created_time,from,object_id";
$fbApiGetPosts = $facebook->api('/' . $page_id . '/feed?limit=' . $limit . '&fields=' . $fields);
$getFb = array();
if (isset($fbApiGetPosts["data"]) && !empty($fbApiGetPosts["data"])) {
echo '<ul>';
foreach($fbApiGetPosts["data"] as $data)
{
echo '<li>' . substr($data['message'], 0, 140) . '</li>';
}
echo '</ul>';
}
/{page_id}/posts
端点仅显示页面自己的帖子(如果这是您的意思):
/{page-id}/posts
shows only the posts that were published by this page.