我有一个有效的页面访问令牌,我正在尝试将图片发布到相册(此相册:https ://www.facebook.com/media/set/?set=a.333031973457854.77237.323448221082896&type= 3)相册然后 ID 是:333031973457854.77237.323448221082896 但我收到此错误:OAuthException:(#803)您请求的某些别名不存在:33303197345785477237323448221082896(<--正如您看到的专辑ID)谁能指导我通过我所拥有的做错了,我应该如何解决?谢谢 :) 这是我的代码:
<?php
$fbconfig['appid' ] = "172098812914132";
$fbconfig['secret'] = "XXXXXXXXXXXXXXXXX";
$fbconfig['pageid'] = "323448221082896";
$fbconfig['token1'] = "XXXXXXXXXXXXXXXX";
$fbconfig['token2'] = "XXXXXXXXXXXX";
$fbconfig['my_ulr'] = 'http://'.$_SERVER['SERVER_NAME'];
$albumid = '33303197345785477237323448221082896';
require_once('../scripts/facebook.php');
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
));
$pageid = $fbconfig['pageid'];
$imagesDir = 'images/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
printf("Trying to upload: " . $randomImage . "\n"); // The path to the random image.
try
{
// $page_info = $facebook->api("/$pageid?fields=access_token");
// Album ID 33303197345785477237323448221082896
$args = array(
'access_token' => $fbconfig['token2'],
'source' => 'www.gorillalol.com/i/' . $randomImage,
);
$post_id = $facebook->api("/" . $albumid . "/photos","post",$args);
unlink($randomImage); // Deletes the file, so it can't get reposted.
printf("Successful Image Upload :)");
}
catch (FacebookApiException $e)
{
printf("Failed. :p");
printf($e);
}
?>