duanbin198788 2014-10-24 10:16
浏览 46
已采纳

获取Facebook身份的人如何在我的时间轴上标记我

Currently i'm working on a website for a client. I want to show his latest Facebook wall posts on his website, also posts he is tagged in by others. With the Facebook Graph i can get allot of data from the latest post like message, description, picture etc. But i just can't find or get the Facebook id of the person who tagged him in that post... Only his own Facebook id and the id's of the others persons who where tagged, but not the tagger (if that is even a word :P)

Can anybody help me with this?

I'm using /feed in the Facebook Graph to get the data from the posts on his wall

$fb_id = 'your-facebook-id';
$fb_token = 'my-acces-token'; // tokken obtained from Facebook graph explorer page

$fb_response = file_get_contents('https://graph.facebook.com/'.$fb_id.'/feed?access_token='.$fb_token);
$fb_array = json_decode($fb_response, true);

Thanks for your time!!

  • 写回答

1条回答 默认 最新

  • dtoqemais553654797 2014-10-24 12:30
    关注

    If I understand you correctly, you just need to find the ID of a user that posted a status update that tagged your client.

    Do things as you were before, by collecting objects from the /user/feed edge. You should retrieve an ID for the status. With this, make another call to the Graph for /STATUS_ID. This will give you information about who posted the status along with other things.

    https://developers.facebook.com/docs/graph-api/reference/v2.1/post

    Note that this will only work for public posts with any valid access token. If the post is not public, you may not be able to retrieve the post with a user's access token that is not the original user who posted the status. Keep in mind that the docs specifically state:

    Only posts whose authors have also granted read_stream permission to the app will be shown for /user/feed.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么