2012-08-05 38 views
0

我可以上传照片并包含Graph API的链接吗?我只想包含Instagram应用程序的原始文章链接。我希望它看起来像这样:如何在图表API中插入我上传的照片中的链接

picture-name -- http://myhost.com/link/to/original/post 

我的代码是这样的:

$post_link = get_permalink($post_id); 

$file='sample.jpg'; 
$photo_details = array(
    'message'=> 'Photo message', 
    'source' => '@' . realpath($file) 
); 

$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details); 

我可以上传我的图片至Facebook相册的,但我想包括在Photo message右边我的文章的链接。

回答

0

你的意思是你只需要把链接追加到当前的消息就像这样?

$post_link = get_permalink($post_id); 

    $file='sample.jpg'; 
    $photo_details = array(
    'message'=> 'Photo message - '.$post_link, 
    'source' => '@' . realpath($file) 
    ); 
    $upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details); 
相关问题