通过api检索facebook分享数 [英] Retrieving facebook share count via api
本文介绍了通过api检索facebook分享数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
like_count目前在 422493 附近。但是,如果我运行这个jQuery脚本( JSFiddle ),它会显示 1318998 。这个脚本有什么问题吗?
< script>
$ .ajax({
url:http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.yahoo.com;,
dataType:xml
})。done(function(data){
var $ xml = $(data),
$ title = $ xml.find(like_count );
$('#fbshare')。text($ title.text());
});
< / script>
< div id =fbshare>< / div>
API从这里引用: https://developers.facebook.com/blog/post/2009/10/26/extending-facebook-share/
解决方案
尝试此FQL查询,希望这将有所帮助。
Im trying to get like counts from facebook's api. If you access this url http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.yahoo.com
the like_count is currently around 422493. But if I run this jQuery script(JSFiddle) it displays 1318998. Is there something wrong with this script?
<script>
$.ajax({
url: "http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.yahoo.com;",
dataType: "xml"
}).done(function(data) {
var $xml = $(data),
$title = $xml.find("like_count");
$('#fbshare').text($title.text());
});
</script>
<div id="fbshare"></div>
API is referenced from here: https://developers.facebook.com/blog/post/2009/10/26/extending-facebook-share/
解决方案
Try this FQL query,Hope this would help.
这篇关于通过api检索facebook分享数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文