0
我正在编写一个应用程序,允许用户一次上传多张照片到Facebook,并且在发生这种情况时,它会自动在照片中标记自己(没有其他人)。PhotosDuplicateTagInBatch在Facebook上传/标记照片时出现错误!
如果我运行脚本一次,它工作正常,如果我尝试上传和标记多张照片,然后它抱怨PhotosDuplicateTagInBatch
错误,我无法找到任何信息,为什么发生这种情况!
这里是我的代码:
for ($i = 5; $i >= 1; $i--)
{
$img = GetImage($i);
$tag = array(
'tag_uid' => $facebook->getUser(),
'x' => rand (0,100),
'y' => rand (0,100)
);
$tags[] = json_encode($tag);
$args = array(
'message' => $i,
'image' => '@'.realpath($img),
'tags' => $tags,
);
$data = $facebook->api('/me/photos', 'post', $args);
}
}
如果我输出我的论点,他们出来为: 代码:
Array
(
[message] => 4
[image] => @imagepathhere
[tags] => Array
(
[0] => {"tag_uid":"100002493436028","x":13,"y":68}
[1] => {"tag_uid":"100002493436028","x":60,"y":57}
)
)