2010-07-02 3 views
1

페이스 북에서 iframe 응용 프로그램을 개발할 때 이전 Rest API (및 이전 Javascript SDK)를 사용하고 있습니다.stream.Publish에 html을 포함하는 방법

그러나 새 줄을 포함하고 프로필에 대한 링크가있는 사람의 이름을 포함하는 벽 게시 (stream.Publish 호출)를하고 싶습니다. 그러나 나는 HTML 콘텐츠를 포함 할 때마다, FB는 스트립 ..하지만 일부 응용 프로그램이 그것을 할 있기 때문에, 예를 들어, 수행 할 수 있습니다 알고

http://img.skitch.com/20100702-jhqradpi3td4d53sdb3qin92sb.png

건배, '제

답변

1

당신은 할 수 없습니다 벽 게시물의 임의의 HTML. HTML처럼 보이면 Facebook에서이를 제거합니다. 페이스 북에서 할 수있는 유일한 변경 사항은 링크처럼 보이는 텍스트를 변환하는 것입니다 (따라서 메시지에 어딘가에 http://www.google.com이 있으면 페이스 북에서 자동으로 링크로 바꿀 것입니다).

그러나 Facebook은 추가 매개 변수를 전달하여 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 : 이것은 페이스 북의 문서 (http://wiki.developers.facebook.com/index.php/Stream.publish)에서 이러한 것들을 몇 가지를 포함하는 예입니다.

관련 문제