Get the number of comments using the Facebook API

1

I'm trying to get the number of comments on a specific link, I currently do this:

<span
    class="fb-comments-count fb_comments_count_zero"
    data-href="http://la-url-dónde-hay-comentarios/"
    fb-xfbml-state="rendered"
>

However, for some months now, he has thrown this warning:

  

fb: comments-count has been deprecated. Please use FB.api() .
link

I want to do the migration using FB.api() , but I can not find specific information in the link documentation, the last thing I tried to do is:

FB.api(
    "/",
    {
        "id": "http:\/\/www.ejemplo.com\/\/comments"
    },
    function (response) {
        console.log(response);
    }
);

But only an object returns with the id and nothing else.

    
asked by Jesús Sánchez 20.08.2018 в 19:57
source

0 answers