[英]Is it possible to fetch sale posts from facebook group using graph api
[英]unable to fetch data from close group using Facebook graph api
我無法從Facebook獲取封閉的論壇帖子。 由於我是該組的成員,但我無法通過圖形api中的訪問令牌訪問它。 但是我可以使用我作為成員的訪問令牌從開放組中獲取所有數據。
我正在使用以下網址:[ https://graph.facebook.com/my-group-id/feed?access_token=my-access-token]
我的代碼:
<?php
$group = array(
array('id'=>'xxxx','name'=>'zzzzz'),
array('id'=>'xxx' , 'name'=>'yyyy'),
);
$access_token = 'my token';
$n = count($group);
$i = -1;
while($n--){
$i++;
$add = 'https://graph.facebook.com/'.$group[$i]['id'].'/feed?fields=id,name,story,message,updated_time&access_token='.$access_token;
$json = file_get_contents($add);
$data = json_decode($json);
if($json){
foreach($data->data as $item){
$post_id = $item->id;
$name = $item->name;
$date = $item->updated_time;
$story = $item->story;
$message = $item->message;
}
}
}
?>
自應用版本2.4起,Facebook已停止允許Graph API上的組供稿(非公開)。
如果希望使用此功能,則暫時需要版本2.1-2.3的應用程序。 用法和API文檔可在此處找到。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.