2010-07-02 53 views

回答

1

你不能有在墙上张贴任意的HTML。如果它看起来像HTML,Facebook将剥离它。我相信Facebook将做的唯一的其他变更就是将链接看起来像链接转换成链接(所以如果你在邮件的某个地方有http://www.google.com,Facebook会自动将它变成链接)。

但是Facebook并通过传递额外的参数,包括像图片,标题,描述,链接等通过stream.publish基本的东西,提供基本的设施。这是包括一些这些东西从Facebook的文档(http://wiki.developers.facebook.com/index.php/Stream.publish)的例子:

$message = 'Check out this cute pic.'; 
$attachment = array(
     'name' => 'i\'m bursting with joy', 
     'href' => 'http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/', 
     'caption' => '{*actor*} rated the lolcat 5 stars', 
     'description' => 'a funny looking cat', 
     'properties' => array('category' => array(
          'text' => 'humor', 
          'href' => 'http://www.icanhascheezburger.com/category/humor'), 
          'ratings' => '5 stars'), 
     'media' => array(array('type' => 'image', 
          'src' => 'http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg', 
          'href' => 'http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/')), 
     'latitude' => '41.4',  //Let's add some custom metadata in the form of key/value pairs 
     'longitude' => '2.19'); 
$action_links = array(
         array('text' => 'Recaption this', 
          'href' => 'http://mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#step2')); 
$attachment = json_encode($attachment); 
$action_links = json_encode($action_links); 
$facebook->api_client->stream_publish($message, $attachment, $action_links); 

检查this出来什么附件可以包含更多的信息。