dongshenyu4638 2015-11-10 09:11
浏览 63

获取用户朋友的facebook帖子,其中包括“xyz is feeling ***”

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!

i have highlighted what im trying to get in this picture

This is the response from Facebook Graph API explorer

  • 写回答

1条回答 默认 最新

  • douwen9343 2015-11-20 13:39
    关注

    There is no way to get it using facebook graph api.

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP