一千萬個為什麽

搜索

通過Post隱私過濾Facebook Stream?

我查詢我的Facebook標簽中的一些墻數據。 我想知道如何過濾數據(查詢)以僅顯示某個國家/地區可見的帖子。

$query = "  SELECT 
            post_id, created_time, attachment,action_links, privacy
        FROM 
            stream 
        WHERE 
            source_id = ".$page_id." 
            AND viewer_id = ".$user_id."
            AND actor_id = ".$actor_id."
        LIMIT
            50";

輸出已經顯示澳大利亞:但是如何過濾僅限澳大利亞。

Array (
[posts] => Array
    (
        [0] => Array
            (
                [post_id] => 123
                [viewer_id] => 123
                [source_id] => 123
                [type] => 46
                [app_id] => 
                [attribution] => 
                [actor_id] => 123
                [target_id] => 
                [message] => Only for Austria
                [attachment] => Array
                    (
                        [description] => 
                    )

                [app_data] => 
                [action_links] => 
                [comments] => Array
                    (
                        [can_remove] => 1
                        [can_post] => 1
                        [count] => 0
                        [comment_list] => 
                    )

                [likes] => Array
                    (
                        [href] => http://www.facebook.com/social_graph.php?node_id=118229678189906&class=LikeManager
                        [count] => 0
                        [sample] => 
                        [friends] => 
                        [user_likes] => 0
                        [can_like] => 1
                    )

                [privacy] => Array
                    (
                        [description] => Austria
                        [value] => CUSTOM
                        [friends] => 
                        [networks] => 
                        [allow] => 
                        [deny] => 
                    )

                [updated_time] => 1271520716
                [created_time] => 1271520716
                [tagged_ids] => 
                [is_hidden] => 0
                [filter_key] => 
                [permalink] => http://www.facebook.com/pages/
            )

最佳答案

我想你必須在查詢中添加另一個過濾器:

$query = "  SELECT 
        post_id, created_time, attachment,action_links, privacy
    FROM 
        stream 
    WHERE 
        source_id = ".$page_id." 
        AND viewer_id = ".$user_id."
        AND actor_id = ".$actor_id."
        AND privacy = ".$your_privacy_filter//Austria, in this case.
    LIMIT
        50";

也許過濾器必須是這樣的:

//...
"AND privacy.description = ".$your_privacy_filter

轉載註明原文: 通過Post隱私過濾Facebook Stream?