facebook 分享计数 - 具有不同 URL 的 FQL 问题
我的页面上有一个插件,允许用户在 Facebook 上分享我网站上的文章,但每个 url 都附加了他们的用户 ID。
我想要做的是计算总共享数,而不考虑共享者的用户 ID。
但是我无法让 FQL 工作,因为 where 参数不接受 LIKE 函数。
页面将类似于:
page1.php?sid=2 page1.php?sid=34 page1.php?sid=12
但我想检索 page1.php 的总份额,无论 sid 是什么。
LIKE 函数在 FQL 中不起作用,有人有任何想法吗,因为我正在努力处理
当前的代码:
https:// api.facebook.com/method/fql.que … ge1.php%27
I have a plugin on my page which allows users to share articles on my site on facebook, but each url is appended with their user id.
What I want to do is count the number of total share regardless of the shareers user id.
However I cannot get the FQL to work as the where parameter will not accept the LIKE function..
the pages will be something like:
page1.php?sid=2
page1.php?sid=34
page1.php?sid=12
But I want to retrieve the total shares for page1.php regardless of the sid.
The LIKE function doesnot work in FQL does anyone have any ideas as I am struggling
current code:
https://api.facebook.com/method/fql.que … ge1.php%27
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 FQL 进行查询:
这里,
total_count
为您提供链接的共享数量。如果您有多个要查询的 URL,则可以使用
OR
在一次查询中完成所有这些操作:以下是一个示例,您想要获取这 3 个 URL 的共享数量:
以及
$data
是一个由 3 个对象组成的数组,其中包含每个 URL 的共享号:然后您只需遍历该数组即可求和。
希望有帮助!
You can use FQL to make your query :
Here,
total_count
gives you the number of shares for the link.If you have several URL to query, you can make all of that in only one query by using
OR
:Here is an example is you want to get the number of shares for theses 3 URLs :
And
$data
is an array of 3 objects with the share number for each URL :Then you just have to go through the array to make a sum.
Hope that helps !