我可以使用Facebook graph API获得大量的份额吗?和怎么做 [英] Can i get lots of share counts using facebook graph API? And how to do it
问题描述
我的想法是实现这样的东西:
My idea is to implement something like this:
截图来自这里: http://www.thedrum.co.uk/opinion/ 2012/03/08 / five-way-new-facebook-timeline-will-impact-brands
我看过我必须使用Facebook图形API或FQL,但我不知道哪一个是最好的。
I've read that I have to use either Facebook graph API or FQL but I don't know which one is the best.
这是我到目前为止,但需要很长时间才能做到这一点我的猜测这是错误的方法:
This is what I have so far but it takes a long to do it so my guess is that is the wrong method:
<? require_once 'libs/facebook.php';
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => 'appid',
'secret' => 'secret',
'cookie' => true,
));
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => 'SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url="URL";'
));
echo '<p>'.$result[0]['like_count'].' likes';
?>
如果我尝试获得共享数(使用之前提到的方法之一)让我们说我的主页上有50个不同的帖子? Facebook没有限制吗?
Is it OK if I try to get the share count (using one of the methods mentioned before) of let's say 50 different posts I have on my home page? Doesn't Facebook have a limit for this?
推荐答案
使用图形API。 FQL仍然有效,但它不是Facebook的优先事项之一。
Use the graph API. FQL still works but it isn't one of Facebook's priorities.
这是链接,以便您可以看到它的工作原理: https://developers.facebook.com/docs/reference/api/
Here is the link so you can see how it works: https://developers.facebook.com/docs/reference/api/
其次缓冲数字,所以你没有打Facebook每次都会收到更快的页面加载。
Secondly buffer the number so you aren't hitting Facebook everytime and will get faster page loads on your end.
这篇关于我可以使用Facebook graph API获得大量的份额吗?和怎么做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!