php - Facebook Comment Count on Comments Plugin -


i run many news sites use facebook comments plugin, e.g.

<script>     (function(d, s, id) {       var js, fjs = d.getelementsbytagname(s)[0];       if (d.getelementbyid(id)) return;       js = d.createelement(s); js.id = id;       js.src = "//connect.facebook.net/en_us/sdk.js#version=v2.3&xfbml=1&appid={appid}";       fjs.parentnode.insertbefore(js, fjs);     }(document, 'script', 'facebook-jssdk')); </script> 

this display comment plugin total count @ top, relative current site, not total comments on of facebook. number i'm looking get.

now, want make widget on sites find top commented articles. i'm using ancient rest api this:

$rest_url = "http://api.facebook.com/restserver.php?format=json&method=links.getstats&urls=".$allurls; $json = json_decode(file_get_contents($rest_url),true); 

where $allurls comma-separated list of article urls. however, comment_count returns total number of comments on fb. if have article 7 comments submitted via plugin, comment_count 20, example, if there comments elsewhere on fb. see commentsbox_count in there looks need, it's showing 0.

so, list of urls on site , appid, how query facebook return "local" comment count? need via php can sort values, fbml won't work me.


edit - tried fql query , got same results:

$fql  = "select comment_count link_stat url = '$url'"; $fqlurl = "https://api.facebook.com/method/fql.query?format=json&query=" . urlencode($fql); 


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -