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.

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度