我的问题很简单。如何使用 PHP 在最近的股票和活动上发布但不在墙上(时间线)上。(发布动作)。我已经用 javascript 完成了,但我想要它在 php 中
我已经测试过了:
$params = array(
'message' => "This post is a test",
'name' => "Titre de mon test",
'caption' => "My Caption",
'description' => "Some Description...",
'link' => "http://stackoverflow.com",
'actions' => array('name'=>'Recipe','link'=>'url'),
'picture' => "http://i.imgur.com/VUBz8.png",
);
$post = $facebook->api("/$user/feed","POST",$params);
谢谢。
我发现编辑:
我发现
<meta property="og:title" content="My article" />
<meta property="og:type" content="namespace:recipe" />
<meta property="og:url" content="http://url/" />
<meta property="og:image" content="" />
<meta property="fb:app_id" content="apikey" />
<meta property="og:description" content="My wonderful article" />
和php
try {
$action = array('name' => 'recipe', 'link' => 'http://url/');
$actions = json_encode($action);
$params = array('recipe'=>'http://url/','access_token'=>$facebook->getAccessToken(), 'actions'=> urlencode($actions));
$out = $facebook->api('/me/namespace:cook','post',$params);
echo "Your post was successfully posted to UID: $user";
}
catch (FacebookApiException $e) {
$result = $e->getResult();
}
}