2010-04-17 87 views
0

我查詢我的臉書標籤中的一些牆數據。 我想知道如何過濾數據(查詢),以顯示僅對某個國家可見的帖子。過濾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/ 
      ) 

回答

2

我認爲你必須到其他過濾器添加到查詢:

$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