2011-09-18 88 views
2

我想發佈在我的朋友的牆上使用FB的PHP SDK。該代碼僅在我的牆上發佈帖子,而其他人不可見。發佈在朋友的牆上使用PHP的Facebook的Facebook

下面是代碼

$ret_obj = $facebook->api('/me/feed', 'POST',array(
      'link' => 'www.google.com', 
      'message' => 'message','description' => "I am bond", 
      'to' => array('id' => 'friend_id','name' => 'friend_name'), 
      'actions' => array('name' => 'Re-share', 
      'link' =>'http://apps.facebook.com/my_app/'), 
      'privacy' => array('value' => 'EVERYONE'))); 

在我的牆上,而不是朋友的牆壁此代碼發佈。此外,該帖子只對我可見,對其他人不可見。

任何形式的幫助都是非常可觀的。

在此先感謝

回答

5

/me/feed

就是你。

/myFriendsNameHere/feed

這是你的朋友。

https://developers.facebook.com/docs/reference/api/

具體規定「發佈」的第一句在那裏它表明你到底怎麼做你的要求。

+0

感謝您的回覆,但我無法發佈鏈接。而且它對朋友不可見,只有我可以看到帖子 – devsri

1

要發佈一個朋友做牆的HTTP POST到/ freindID /飼料而不是/我/飼料(將張貼到牆上)。另外,刪除'to'參數。

-1
$friends = $facebook->api('me/friends'); 

    //print_r($friends['data']); 
    print_r("Number of friends: ". count($friends['data'])); 

    foreach ($friends['data'] as $key=>$friendList) { 
     echo "<br/>".$key." ".$friendList['name']."<img src='https://graph.facebook.com/".$friendList['id']."/picture' width='50' height='50' title='".$friendList['name']."' />";  
    } 
相關問題