Note that there are some explanatory texts on larger screens.

plurals
  1. POGet facebook comment by id
    text
    copied!<p>I have facebook comment box. I want to store the comment in a database when a user comments something. So I am attaching a callback function with <code>FB.event.subscribe('comment.create', ...</code> From there I get <code>commentID</code> and <code>href</code> but the only way to get the exact comment is with FQL which is deprecated from 2011 and nobody knows when facebook will remove it. Using Graph API I can get all comments but there is no way to find out which comment belongs to a specific user of our app (we don't ask for any permissions so there is no access_token; we trigger popup form when somebody comments so it is very important to match user details with comment (that's why we subscribe to <code>comment.create</code>)). Is there a smart way to do this or should rely on a deprecated feature?</p> <p>Edit:</p> <p>I am trying to get the comment like this:</p> <pre><code>FB.api( { method: 'fql.query', query: "SELECT text, fromid FROM comment WHERE post_fbid = '" + resp.commentID + "' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url='" + resp.href + "')" }, function (data) { var fb_id , comment console.log(data) if ( data.length == 1 ) { fb_id = data[0].fromid comment = data[0].text } // ... } ) </code></pre> <p>The problem is that when on localhost - it returns array with one element - the comment I want. When I upload to my app - then it returns array with no elements. Maybe there are permission issues. My question is how to get the content of a comment when submitted. What is the canonical way? Is it possible without access_token and permissions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload