Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have to use the realtime api from facebook : <a href="http://developers.facebook.com/docs/api/realtime/" rel="nofollow">http://developers.facebook.com/docs/api/realtime/</a></p> <p>To do what you ask, you must subscribe to <code>page</code> objects and their <code>feed</code> connection.</p> <p>To add a subscription you have to send a POST request to : </p> <pre><code>https://graph.facebook.com/&lt;app-id&gt;/subscriptions?access_token=... </code></pre> <p>And for that you need an access token that you can get at :</p> <pre><code>https://graph.facebook.com/oauth/access_token?client_id=&lt;app-id&gt;&amp;client_secret=&lt;app-secret&gt;&amp;grant_type=client_credentials </code></pre> <p>The fields that have to be in the POST data are :</p> <ul> <li><code>object</code> - The type of the object to monitor, e.g. “user” or “permissions”. You will monitor all objects of that type; for example, all users of your application.</li> <li><code>fields</code> - A comma-separated list. This is a list of properties or connections on the specified object. For example, to monitor changes to user's name, picture, friends, and News Feed, you would specify “name,picture,friends,feed”</li> <li><code>callback_url</code> - A callback URL to which Facebook will post subscription updates.</li> </ul> <p>And you can specify</p> <ul> <li><code>verify_token</code> - A subscriber-provided opaque token that will be echoed back in the verification request to assist the subscriber in identifying which subscription request is being verified. If this is not included, no token will be included in the verification request. This is from the PubSubHubbub spec.</li> </ul> <p>Once your callback url has been verified, you will receive updates when data change in the feed of the page on your callback url as json objects, here is an example for a user :</p> <pre><code>{ "object": "user", "entry": [ { "uid": 1335845740, "changed_fields": [ "name", "picture" ], "time": 232323 }, { "uid": 1234, "changed_fields": [ "friends" ], "time": 232325 } ] } </code></pre> <p>You can also do GET and DELETE on the same URL to get the list of your subscriptions, and to delete subscriptions. </p> <p>But all the details are in the <a href="http://developers.facebook.com/docs/api/realtime/" rel="nofollow"> facebook doc</a></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