facebook graph api doesn't return enough news feed details to reconstruct what you see on facebook home page
How can I get more details for news feed posts? (I'm using the latest php sdk v3.0.1)
If I look at my facebook home page I see a post like this:
"Chris XXX and two other friends changed their profile pictures" Crhis' profile picture thumbnail shows to the left and the other two show beneath. here's a screen shot:
I'm trying to duplicate this feed data on my site, but I don't get enough information from graph api. Here is what I've tried and some sample php print_r dumps of the data I get back:
$facebook->api("/me/home");
print_r outputs:
Array
(
[id] => XXX_YYY
[from] => Array ( [name] => Christopher ZZZ [id] => 100BBB )
[picture] => http://profile.ak.fbcdn.net/hprofile-ak-snc4/CCC_DDD_EEE_q.jpg
[link] => http://www.facebook.com/profile.php?id=FFF
[icon] => http://static.ak.fbcdn.net/images/icons/?8:
[type] => link
[application] => Array ( [name] => Photos [id] => 2305272732 )
[created_time] => 2011-08-04T22:26:04+0000
[updated_time] => 2011-08-04T22:26:04+0000
)
XXX_YYY is the ID of that news feed entry.
[picture] and [link] are a thumbnail and link to profile of the first of the "2 other friends" who changed their picture. There is no link to the profile picture of Chris XXX and no mention at all of the other friend who changed their picture.I thou开发者_开发技巧ght I might get more information by requesting for data on that feed entry directly, but that provided even less info:
$result = $facebook->api("/XXX_YYY");
print_r outputs:
Array
(
[id] => XXX_YYY
[from] => Array ( [name] => Christopher ZZZ [id] => 100BBB )
[type] => status
[created_time] => 2011-08-04T22:26:04+0000
[updated_time] => 2011-08-04T22:26:04+0000
)
Please be aware that those profile picture changes you see in the wall are not related each other directly in the database.
All these relationships are calculated concerning some data like:
- the time of each profile picture change of each user
- the kind and level of relationship between those grouped users
- (maybe some additional filters Facebook may apply?)
Unless you have the permission of the main user you are getting that feed info, and the permission of his friends, you cannot relate it directly.
If in some way you get information about both, you will need to write your own grouping functions by post type (in this case - the "profile change" type), replicating Facebook feature.
精彩评论