评论计数的 FQL 查询返回空数组
我试图让这个 FQL 查询返回给定 XID 的评论计数,并在尝试使用它时不断获得空的 Array() 。
需要“./facebook.php”;
$facebook = new Facebook(array( 'appId' => "我的应用 ID", '秘密' =>; “我的秘密”,));
$commentCountquery = "从 comments_info 中选择计数,其中 app_id = '我的应用 ID' AND xid = 'DEFAULTXIDSTRING_post
'";
$参数=数组( '方法' => 'fql.query', '查询' => $commentCount查询, '回调' => '');
$commentCountresult = $facebook->api($param);打印_r( $commentCountresult );
?>
当我使用 http://developers.facebook.com/docs 上的测试控制台时/reference/rest/fql.query/ 我得到一组空括号返回“[]”
我首先使用 Facebook Comments for Wordpress Plugin 将这些评论传递到相关页面。我仔细检查了他们关于如何格式化 XID 的描述(“这个插件需要您的 XID(当您激活插件时随机生成)并附加 _post”),并通过剪切和粘贴来检查页面上呈现的内容来源。我知道这不是我全面实施的方式;我只是想先获取一个已知的 XID,然后再使用更多 PHP 来从每个页面中提取帖子 ID,使其变得复杂。
为什么我的 FQL 查询没有返回值?!
我要感谢所有回答其他人问题的人,让我走到这一步,这只是最后一点(“让它到实际上工作”位)完全让我困惑。
Am trying to get this FQL query to return the comment count for a given XID and keep getting an empty Array()
when I try to use it.
require "./facebook.php";
$facebook = new Facebook(array( 'appId' => "MY APP ID", 'secret' =>
"MY SECRET", ));$commentCountquery = "SELECT count FROM comments_info WHERE app_id =
'MY APP ID' AND xid = 'DEFAULTXIDSTRING_post<mytestpostID>
'";$param = array(
'method' => 'fql.query',
'query' => $commentCountquery,
'callback' => '' );$commentCountresult = $facebook->api($param); print_r(
$commentCountresult );?>
When I use the Test Console at http://developers.facebook.com/docs/reference/rest/fql.query/ I get an empty set of brackets returned "[]"
I am using the Facebook Comments for Wordpress Plugin to deliver these comments to the page in question in the first place. I have double checked their description of how to format the XID ("This plugin takes your XID (which was randomly generated when you activated the plugin) and appends _post") and have checked it against what's rendering on the page by cutting and pasting from the source. I understand that this is not how I would do it in a full scale implementation; I am just trying to get a known XID in before complicating it with more PHP to pull the post ID from each page.
Why doesn't my FQL query return a value?!
I'd like to thank all of those who answered other people's questions for getting me this far, it's just this last bit (the "getting it to actually work" bit) eludes me completely.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论