Fetching third party posts from the Facebook Graph API Fetching third party posts from the Facebook Graph API php php

Fetching third party posts from the Facebook Graph API


Dan, I tried this-

  1. POST a feed from an APP to a Page

    POST: "PAGE_ID/feed"message: "hi"

    Result: Post Successful

  2. Request the list of posts on the Page

    GET: "PAGE_ID/feed"

    Result: All the posts on the Page incl the aforementioned post.


Why it worked?

Because the GET request was made using the access token of the user who is the admin of the app through which the message was posted.

Conclusion

I tried all the cases and final conclusion is that, to fetch the feeds of a page incl that are posted by some APP, you have to use the access token of the admin of that app (not a big issue); else you'll just get the rest of the feeds.


Use a combination of Yahoo Query Language and .ajax() to data scrape the Facebook Feed Channel.

The benefit about data-scraping the LIVE Facebook Member Webpage is you don't need token key to get the latest real-time feeds!

HTML:

<div id="results"></div>

jQuery:

$.ajax({    url: "http://query.yahooapis.com/v1/public/yql",    dataType: "jsonp",    success: function(data) {        console.log(data.query.results.json);        $.each(data.query.results.json.entries, function(i, v) {            $('#results').append(data.query.results.json.entries[i].content + '<br /><br />');        });    },    data: {        q: 'select * from json where url="https://www.facebook.com/feeds/page.php?id=112706495458566&format=json"',        format: "json"    }});

DEMO: Inspired by this online tutorial.

jsFiddle Facebook Feeds


EDIT: Click image for revised jsFiddle with Style


EXTRA:

To complement my answer above, here is quasi-related jsFiddle titled:

jsFiddle Tutorial: Creating Dynamic Div's (Now Improved!)

This tutorial shows how to convert your HTML markup so it becomes a "template" that is ready to use with jQuery as an Object, which then can be appended to the webpage correctly.


When you make a post via the API, Facebook returns to you the ID of that post. You can save these IDs and then query for them later with the graph API or FQL