如何通过图形API(php)标记facebook相册中的人物

时间:2012-02-21 10:58:51

标签: php facebook facebook-graph-api

  

可能重复:
  How can I tag a user in a photo using the Facebook Graph API?

正如标题所说,我如何通过现有专辑上的Facebook图形API标记人物?

1 个答案:

答案 0 :(得分:1)

这是通过Facebook Graph API完成的。

Facebook的核心是社交图;人们和他们所关心的一切关系。 Graph API提供Facebook社交图的简单一致视图,统一表示图中的对象(例如,人物,照片,事件和页面)以及它们之间的连接(例如,朋友关系,共享内容和照片标签) )。

The connections supported for people and pages include:
Friends: https://graph.facebook.com/me/friends?access_token=...
Photo Tags: https://graph.facebook.com/me/photos?access_token=...
Photo Albums: https://graph.facebook.com/me/albums?access_token=...
Video Tags: https://graph.facebook.com/me/videos?access_token=...

或者使用此

$args = array(
  'message' => 'Message',
  'image'   => '@' . realpath($path_to_image),
  'tags'    => array(
     array(
      'tag_uid'=> $friend1_uid,
      'x'      => $x1,
      'y'      => $y1,
     ),
     array(
      'tag_uid' => $friend2_uid,
      'x'       => $x2,
      'y'       => $y2,
     ),/*...*/
   ),
);

$data = $facebook->api('/me/photos', 'post', $args);