Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>FQL isn't deprecated. The blog post is talking about <strong>Rest API</strong> specifically, later on it states changes with FQL.</p> <p>To access comments you need a valid access token that can view the top level object. Assuming this is just for comments on websites, a normal extended page access token should suffice by following scenario 5 explained at <a href="https://developers.facebook.com/roadmap/offline-access-removal/" rel="nofollow">https://developers.facebook.com/roadmap/offline-access-removal/</a></p> <pre><code>https://graph.facebook.com/oauth/access_token? client_id=APP_ID&amp; client_secret=APP_SECRET&amp; grant_type=fb_exchange_token&amp; fb_exchange_token=EXISTING_ACCESS_TOKEN </code></pre> <blockquote> <p>Exchange the short-lived user access token for a long-lived access token using the endpoint and steps explained earlier. By using a long-lived user access token, querying the [User ID]/accounts endpoint will now provide page access tokens that do not expire for pages that a user manages.</p> </blockquote> <p>Then using a page access token from [User ID]/accounts you can pretty much hard code it in (you can create your own backend login tool, in the event that you invalidate the token one day or need to change it) via a server side language for example PHP using the PHP SDK</p> <pre><code>$facebook-&gt;setAccessToken('YOUR_PAGE_TOKEN'); </code></pre> <p>So from here you can do an AJAX POST to the PHP page where the SDK is loaded </p> <pre><code>window.fbAsyncInit = function(){ FB.Event.subscribe('comment.create', function(response) { onCommentCreate(response.commentID); } ); function onCommentCreate(commentID) { $.ajax({ type: 'POST', url: 'createcomment.php', data: {commentid:commentID}, success: function(result) { alert(result); } }); } } </code></pre> <p>and request the comment information from there</p> <pre><code>&lt;?php if ($_SERVER['REQUEST_METHOD'] == 'POST' &amp;&amp; isset( $_POST['commentid'] )) { $commentid = $_POST['commentid']; require 'facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; 'APP_ID_HERE', 'secret' =&gt; 'APP_SECRET_HERE', )); $facebook-&gt;setAccessToken('YOUR_PAGE_TOKEN'); $response = $facebook-&gt;api($commentid); echo $response['from']['id']; } ?&gt; </code></pre> <p>An example of this can be seen at <a href="http://philippeharewood.com/facebook/experiments/createcomment.html" rel="nofollow">http://philippeharewood.com/facebook/experiments/createcomment.html</a></p> <p>References</p> <ul> <li><a href="https://developers.facebook.com/docs/graphapi/guides/comments/" rel="nofollow">https://developers.facebook.com/docs/graphapi/guides/comments/</a></li> <li><a href="https://developers.facebook.com/roadmap/offline-access-removal/" rel="nofollow">https://developers.facebook.com/roadmap/offline-access-removal/</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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