How to get news feed using Facebook graph api? - facebook

I want to get my news feed (just as what is shown on facebook home page) using Facebook graph api
https://graph.facebook.com/me/home
However, the facebook api document says that
this is an outdated view, does not reflect the News Feed on facebook.com:
Are there any other ways ?
Thanks in advance

Yes there is
https://graph.facebook.com/[YOUR_ID]/home
Note though that you will get almost everything you see on your news feed by most recent order and not by Top Stories order which is the default view you get when visiting your own news feed.
Also another thing to note is that you wont get promoted stories in the results.

For all wondering if this still works:
graph.facebook.com/[YOUR_ID]/home
You need the permission read_stream for this. But you wont get this permission, because its deprecated.
Unfortunately the endpoint https://graph.facebook.com/[YOUR_ID]/home and the permission are deprecated and dont work anymore since version 2.4, according to the changelog (search for read_stream).
Currently there is no alternative for reading the news feed. Only the user's posts can be obtained.
See this for reference: Get Home feed requires read_stream which is deprecated?

Related

How to get the list of the pages i have liked on facebook using Graph API or FQL?

I am scratching my head from a few days to get this thing done but i am not able to do it. developer.facebook says FQL is not available anymore and graph API do not provide any such thing.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/likes
You need the "user_likes" permission, check out the docs for example code.
This will only return the Facebook Pages you like, it is NOT possible to get a list of all external links you like afaik.

Facebook Like Box - Posts by others not appearing

I am trying to implement the Facebook like box onto my website to show posts by others onto my Facebook page, however it is only showing a feed of the posts the page has made to its timeline and not the posts of other Facebook users.
I'm not sure how I can get this to happen? I'm not bothered about having the page's posts appear but I definitely want other's posts to appear in the feed.
Any help would be greatly appreciated!
Afaik the Plugin only shows posts "by the Page", so that is intentional. Think of it this way: If you get many User postings and only write a few Page postings, your Page postings would just not be very visible in the plugin.
You can only use the "force_checkin" parameter of the plugin to show checkins of friends, see Facebook docs: https://developers.facebook.com/docs/plugins/like-box-for-pages
If you want to get the posts of Users on a Page, you would have to use the Graph API: https://developers.facebook.com/docs/graph-api/reference/v2.1/page/feed
The docs include some example code for most relevant languages and you will get User posts too. Of course you have to design it on your own, you just get data from the API.

Get user's detailed newsfeed(wall) posts in Facebook

I would like to build a project to know users' behavior when they surf facebook website, especially the advertisements showing in their timeline wall. I have learned the basic idea of facebook graph api, knowing how to access the users' information and their feeds. However, I found that the feeds returned by facebook graph api is not "exactly" what user really see when they open facebook url in their browser. First, in graph api, it doesn't show the advertisements posted by sponsors. Second, the feeds returned by facebook api seem only regarding to my own posts(e.g. the photo tagging me, the posts tagging me). So, I would like to know how to access these information to rebuild a testbed that looks like exactly same as the real facebook website to record people reaction to it and continue my research?
Any idea is welcome ^^
This isn't really possible or rather I don't know any API (Facebook/Twitter/etc) that would do this to their third-party developers. The point of the API is to pull user data, not ads.
Also it sounds like you are using /me/posts or/me/feed instead of /me/home

Facebook Graph API shows different results in me/home

When I do a GET with my browser (already logged-in at Facebook):
https://graph.facebook.com/me/home?access_token={token}
the results are different than doing the same via a FB app using Facebook C# SDK.
Specifically, what the API is not returning are feeds posted by other applications.
Why can be this happening? Can't an application retrieve updates from other applications even if it has the read_stream permission?
I even requested for additional permissions: read_stream,user_activities,friends_activities,friends_likes,user_likes,read_requests
but nothing has changed.
What I need is to get ALL and the same stories an user would see at his FB news feed.
I use
me/feed
me/posts
me/statuses
me/links
Sample for a page: http://apps.facebook.com/anotherfeed/wallfeed.php uses the /pageid/feed
In filtering for my wall plugin. Even with perms, if a friend has interacted with a post and is not sharing interaction the post will not show in Graph. Technically unless you have perms from all friends, and friends of friends you can not fully emulate the wall feed.
I noticed the results are different according the geo-localisation.
If your server is hosted in another country it might be the reason why

using Facebook api to access recent activity section

A user's wall has sections titled "Recent Activity" which include links to posts that the user has liked or commented on, plus recently used applications, new friends etc.
Is there a programmatic way to access this information using Facebook api or something else?
I noticed this info isn't included in user feed.
thanks alot
Isn't this the same with user feed? If so you can query the graph API by calling:
https://graph.facebook.com/<facebookID>/feed?access_token=<your access token>
Good luck!
As far as I can tell, this information isn't available through any API that Facebook offers.