如何使用Facebook Graph API获取Facebook标签提要?我想获取特定#HashTag的所有帖子。
我尝试了以下代码:
<?php
$keyword = '#TagName';
$graph_url = "https://graph.facebook.com/search?type=post&access_token=xxx&q=$keyword";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $graph_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
var_dump($result);
?>
但它返回一个错误:
string(82) "{" error":{"message":"No node specified","type":"GraphMethodException","code":100}}"
授予的权限:read_stream
有什么解决办法吗?感谢
您无法使用API检索标签提要,除非您使用的是Facebook Trending API(您将无法访问)
https://developers.facebook.com/docs/graph-api/reference/v2.3/hashtag