Hello,
I've been trying to retrieve someone's facebook feed using both php and javascript but nothing has worked so far. According to what I've tried, a session is needed to retrieve an access token and therefore be able to see someone else's publicly feed -
https://developers.facebook.com/docs/facebook-login/access-tokens/#usertokensIf we try the following url:
https://graph.facebook.com/PAGE-ID/feed it returns an error saying that an access token is required to request this resource.
Below's my
javascript attempt, based on the facebook sdk documentation:
http://pastebin.com/2KkU0iyFThing is, the
/PAGE-ID/feed is returning an empty array. I've tried to ask for something like
/me and it prints basic information in the console, like name, id, username and so on.
Console output:
Objectdata: Array[0]
__proto__: ObjectI believe I'm missing something simple like permissions or so (I tried to use scope in the login phase). However, according to the Graph API documentation (
https://developers.facebook.com/docs/graph-api/reference/v2.2/post/),
any valid access token should work if the post is public.
PHP attempt: http://pastebin.com/4wCBqSTuFirst things first. Do I really need to ask for login here? I only want to read the public posts. Isn't app-id and app-secret enough to generate the session?
According to the documentation, the
/feed returns an array of
post objects.
However, when I use
/PAGE-ID/feed the return is an empty array:
[backingData:protected] => Array ( ) If I use
/PAGE-ID only, it prints the basic information, such as username, name, etc..
Any suggestions?
Thanks