As I understand your question, you need to make use of the Facebook API to collect data and/or feed of a particular user receiving them in the form of an object.
If you make a HTTP Get
to the address graph.facebook.com
with parameters appropriate to what you want and a valid Access Token, you will receive back a JSON object with the information you want.
There are three types of data that fall within what are called feed, which leads you to use the appropriate link for what you want to collect, in order to make a HTTP Get
and collect information:
Status updates status updates
http://graph.facebook.com/IdUtilizador/statuses?access_token=TokenDeAcessoValido
List of user wall entries Wall stream
http://graph.facebook.com/IdUtilizador/wall?access_token=TokenDeAcessoValido
List of items in the user’s home home feed
http://graph.facebook.com/IdUtilizador/home?access_token=TokenDeAcessoValido
The Facebook documentation for this subject can be found here (English).
The information received is a JSON that is an object thus addressing your problem.
Example in Jsfiddle
Below is an example of the data format we receive:
{
"id": "220439",
"name": "Bret Taylor",
"first_name": "Bret",
"last_name": "Taylor",
"link": "http://www.facebook.com/btaylor",
"gender": "male",
"locale": "en_US",
"username": "btaylor"
}
The use is relatively simple:
var endereco = "http://graph.facebook.com/btaylor";
$.getJSON(endereco, function(data) {
var name = data["name"];
$("#meuElemento").append("<h3>"+name+"</h3>");
});
There are also other examples of information that can be collected in the form of objects. On this page (English), among many are those I mentioned above.
Using the Facebook query language, you can perform identical SQL queries and collect the data in a more practical way and without "garbage":
On the page of Overview (English), they have a number of examples, but we go by collecting the name as illustrated above:
var endereco = "http://graph.facebook.com/";
var consulta = "fql?q=SELECT name FROM user WHERE uid = me()";
var tokenAcesso = "&access_token=XXXX";
$.getJSON(endereco+consulta+tokenAcesso, function(data) {
var name = data["name"];
$("#meuElemento").append("<h3>"+name+"</h3>");
});
Queries can be tested on Graph Explorer (English).
What would be this Validated Access Token and User ID and how do I? Can you give me an example of a public page?
– Phellipe Lins
Since I want to display in the feed the one-page Mural I think would be the Wall Stream, correct?
– Phellipe Lins
@Phellipelins You can visit this page to get the access tokens for the created application. Here also get more useful information on the subject.
– Zuul
@Phellipelins By the way, it should be said that Apps can be created and managed here. Switch to the Portuguese language at the bottom of the site if you’re uncomfortable with English.
– Zuul
@Zuuul, do you know how to filter the posts? I wanted in JSON only the posts made by the page itself.
– Phellipe Lins
"Graph.facebook.com/ID/feed? access_token=TOKEN&user=MY%20PAGINA" Does not work .-.
– Phellipe Lins
@Phellipelins I only sell when I return to the office, I say something later.
– Zuul
I got it using the '/posts? acess_token={token}'. Now I’m struggling to throw the JSON object to a variable and use it. :/
– Phellipe Lins
let’s go continue this discussão in chat
– Zuul