2
我正在使用PHP SDK在Facebook頁面上載/發佈mp3文件。我有一個WordPress博客,並使用cron作業安排發佈。 Cron的工作沒有問題,除了上傳這些mp3文件外,一切似乎都很好。如何使用Facebook Graph API上傳mp3文件[PHP SDK]
我想發佈這些MP3文件與我的Facebook頁面上的這些帖子。 目前我正在使用下面的代碼。請附上我附加MP3文件時出錯的地方。 我已經嘗試從附件參數中刪除「媒體」。
$args = array(
'access_token' => $post_access_token,
'uid' => $fb_page_id,
'message' => $post->post_title,
'name' => $post->post_title,
'caption' => get_bloginfo('name'),
'link' => get_permalink($post_id),
'picture' => urldecode(get_post_meta($post_id, 'image_value', true)),
'description' => $this->auto_make_excerpt($post->post_content),
'attachment' => json_encode(array(
"media" =>
array(
'type' => 'mp3',
"src" => urlencode("http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3"),
"title" => "15 Step",
"artist" => "Radiohead",
"album" => "In Rainbows"
)
)),
'actions' => json_encode(array(
array(
'name' => 'Share',
'link' => 'http://www.facebook.com/sharer.php?u='.urlencode(get_permalink($post_id)).'&t='.$post->post_title
)
))
);$responseId = $this->facebook->api('/'.$fb_page_id.'/feed', 'POST', $args);