J'essaie d'afficher Facebook commentaire compte dans <div id="comments">
API Facebook - commentaire compter via FQL
Il doit être via Facebook Query Language (FQL). Ce poste est presque exactement ce que je dois: Facebook Graph Api url comments and shares count doesn't work anymore
Mais comment puis-je afficher le comment_count
(de la requête) dans un div
? c'est-à-dire comment puis-je traiter ces données? Jusqu'à présent, j'ai:
$(function(){
$.ajax({
url: 'https://graph.facebook.com/fql?q=SELECT%20comment_count%20FROM%20link_stat%20WHERE%20url=%27e',
dataType: 'jsonp',
success: function(data) {
if(data.comment_count)
{
$('body').find('#comments').html('Comments ('+jsonp.data.comment_count+')');
}else{
$('body').find('#comments').html('Comments (0)');
}
}
});
});
est-ce parfait? – Hemc
Salut! - l'URL est juste un exemple: une URL complète serait, par exemple: https://graph.facebook.com/fql?q=SELECT%20comment_count%20FROM%20link_stat%20WHERE%20url=%27google.com%27 – melusinefile