How do I determine the object that was liked by a user?

岁酱吖の 提交于 2019-12-11 23:52:42

问题


I'm doing a FQL query to get posts from a user:

{
  "feeds": "SELECT type, actor_id, target_id, app_data, action_links, permalink, post_id, viewer_id, created_time, updated_time, source_id, message, description, attachment FROM stream WHERE filter_key = 'owner' AND source_id = <userId> AND is_hidden = 0 LIMIT 50"
}

For the most part, the results are great. However, if the result contains a post about the user "liking" something, how can I determine what was "liked"?

For example:

{
      "type": null, 
      "actor_id": <userId>, 
      "target_id": null, 
      "app_data": [
      ], 
      "action_links": null, 
      "permalink": "", 
      "post_id": "<postId>", 
      "viewer_id": <userId>, 
      "created_time": 1369109320, 
      "updated_time": 1369109320, 
      "source_id": <userId>, 
      "message": "", 
      "description": "<user name> likes a status.", 
      "attachment": {
        "description": ""
      }
    }

Which status?

Or:

{
      "type": null, 
      "actor_id": <userId>, 
      "target_id": null, 
      "app_data": [
      ], 
      "action_links": null, 
      "permalink": "", 
      "post_id": "<postId>", 
      "viewer_id": <userId>, 
      "created_time": 1367029922, 
      "updated_time": 1367029922, 
      "source_id": <userId>, 
      "message": "", 
      "description": "<user name> likes a link.", 
      "attachment": {
        "description": ""
      }
    }

Which link?

Do I need to do a multi-part query to get the extra data from a different table? Why is the target_id always null?


回答1:


This is a long standing bug, that hasn't been fixed for reasons unknown https://developers.facebook.com/bugs/522743067756848

There is actually no efficient way to do it in the API.

<postId> = <userid_pId>

The way via Facebook UI would be https://www.facebook.com/userid/posts/pId

I've opened a new bug report but I highly doubt it will be fixed.

https://developers.facebook.com/bugs/648986871793611



来源:https://stackoverflow.com/questions/16778607/how-do-i-determine-the-object-that-was-liked-by-a-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!