I am trying to get a user's friend's post that says "xyz is feeling sad". Problem is i only get that "xyz updated his status". I am coding in php using facebook API. This is the piece of code from my project
$accessToken = $this->getNewLongAccessToken($user_id,$user_id);
$session = $this->getActiveSessionForAccessToken(trim($accessToken));
if ($session) {
try {
$response['feeds'] = (new FacebookRequest(
$session, 'POST', '/?batch='.urlencode(json_encode($posts))
))->execute()->getGraphObject()->asArray();
unset($posts);
} catch (FacebookRequestException $e) {
//die("Exception occured, code: " . $e->getCode());
die(" with message: " . $e->getMessage());
}
} else {
die("invalid session ");
}
}
$response['facebook_friends_ids'] = $facebook_friends_ids;
$users = array();
if(isset($response['feeds']) && !is_null($response['feeds'])){
foreach($response['feeds'] as $f){
if(isset($f->body)){
$users[] = json_decode($f->body);
}
}
}
echo print_r($users);
exit;
Here's my output
[1] => stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[id] => 10204368080380360_10207876135079535
[from] => stdClass Object
(
[name] => XYZ
[id] => 10204368080380360
)
[story] => XYZ updated his status.
[story_tags] => stdClass Object
(
[0] => Array
(
[0] => stdClass Object
(
[id] => 10204368080380360
[name] => XYZ
[type] => user
[offset] => 0
[length] => 16
)
)
)
[actions] => Array
(
[0] => stdClass Object
(
[name] => Comment
[link] => https://www.facebook.com/10204368080380360/posts/10207876135079535
)
[1] => stdClass Object
(
[name] => Like
[link] => https://www.facebook.com/10204368080380360/posts/10207876135079535
)
[2] => stdClass Object
(
[name] => Share
[link] => https://www.facebook.com/10204368080380360/posts/10207876135079535
)
)
[privacy] => stdClass Object
(
[value] =>
[description] =>
[friends] =>
[allow] =>
[deny] =>
)
[type] => status
[status_type] => mobile_status_update
[created_time] => 2015-11-09T11:07:27+0000
[updated_time] => 2015-11-10T07:03:21+0000
[is_hidden] =>
[is_expired] =>
[likes] => stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[id] => 10152657992473469
[name] => **********
)
[1] => stdClass Object
(
[id] => 634582776638368
[name] => *************
)
)
[paging] => stdClass Object
(
[cursors] => stdClass Object
(
[after] => NjM0NTgyNzc2NjM4MzY4
[before] => MTAxNTI2NTc5OTI0NzM0Njk=
)
)
)
So to sum it up, Is there any way i can find out if a friend of a user has updated any "feeling" type of status. Thankyou!