Getting friend's wall post data via facebook API - facebook

I have never used facebook API.As part of my research project, I need to get activity data (the posts made, the links shared etc.) of a user's friends. Is it possible to get this data via facebook API? Do i need permission from user only or i need permission from user's friends too for accessing that data? I am assuming that since a user can see wall posts of his friends when he visits his friend's facebook profile, the same thing is possible using the API too.

Related

How to get my own Facebook user timeline using Graph API?

I would like to get all the posts and updates that are normally displayed in FB official application for MY account (this includes updates from my friends and liked pages).
I wasn't able to find any details how to get that, the only thing I've managed to get is my own posts.
Anyone got any experience with that using current Graph API verion (3.3)?
All the alternate FB clients (ex. Friendly) must be doing this somehow.
There is no way to get ANY data of users who did not authorized your App. Which means, there is no way to get posts of friends. You can only get your own friends, with the user_posts permission and the /me/posts endpoint. If some Apps access friend data without their authorization, they are most likely doing something that is not allowed.
Here is what I found in their API docs:
There are two scopes:
The user feed requires the user's permission
The public feed has fewer capabilities but doesn't require perms

How to get OTHER users' photos and albums with Facebook Graph API

Scenario: logged with my Facebook account and using a browser, I'm able to see some photos and albums of some users which aren't friends of mine (with a privacy setting of public or similar) and quite all their past profile photos.
For example the URL
https://www.facebook.com/<userid>/photos_all shows those photos.
I want to replicate behaviour with Graph API but GETting
https://graph.facebook.com/<userid>/photos?access_token=...
Gives me an empty data array.
Same scenario using tagged or albums instead of photos
I've tried to use site scraping but FB website uses AJAX to populate gridview of photos, so It's very difficult.
On Graph API Explorer I've requested and use an access token with all permissions and also a debug access token but I'm still unable to get other users' photos.
It's possibile to get photos of users which aren't in friend list with Facebook Graph API? Am I missing something?
For privacy reasons, it´s not possible to get the photos of OTHER users with the API. Even for the authorized user, you need the user_photos permission.
Scraping is not allowed btw: https://www.facebook.com/apps/site_scraping_tos_terms.php

How to get posts from wall as facebook feed

I have a problem with Facebook. Let me explain what I'm trying to do. My friend granted me access to his fanpage as administrator. I would like to get all feeds from fanpage's wall, by using php script on my website. How can I do that ? I don't have any app id or secret id, because this is not an app - it's fanpage.
You can easily retrieve posts from feed connection of page (use posts connection if you only want posts Page own).
You'll need an application to do so because both posts and feed connection require any valid access_token for access.
Once you have access_token you may simple retrieve the posts with Graph API:
http://graph.facebook.com/PAGE_ID/feed?access_token=...

Facebook privilages for getting messages from wall

I created simple facebook app which asks user for user_about_me, user_activites and user_status privilages. Now I want to get all my wall posts, so I make a request and receive only some of my profile data, but without wall posts. I noticed that my access_token is different from the one I can get in documentation: https://developers.facebook.com/docs/reference/api/.
What should I change?
You need read_stream permission.
http://developers.facebook.com/docs/reference/api/permissions/
read_stream Provides access to all the posts in the user's News Feed and
enables your application to perform searches against the user's
News Feed

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