Facebook FQL Get All Posts At Location

时光毁灭记忆、已成空白 提交于 2019-12-10 19:01:39

问题


The location_post FQL table is described as the following:

An FQL table that returns Posts that have locations associated with them and that satisfy at least one of the following conditions:

  • you were tagged in the Post

  • a friend was tagged in the Post

  • you authored the Post

  • a friend authored the Post

So I wrote the following FQL script with the intent of getting all posts my friends and I had made at a certain location:

SELECT id, message, post_id, timestamp FROM location_post WHERE page_id=303736809701751

However, an empty data set is returned. In this particular case, I expect some of my own posts to be returned, though I have tried other place ids that should have returned friends' posts as well.

What is missing from the request, or is this a bug I should report to Facebook?


回答1:


The paragraph you quoted from the doc just says that the table only contains places where yourself and friends of yours have been. It tries to explain that you will not find public users there.

A query to the location_post table does not automatically specify the concerned IDs for you. If you want to search for the places where all your friends have been, you will have to indicate all your friends. If you are only interested by a bunch of friends, just add the concerned IDs.

This should do it.

SELECT id, message, post_id, timestamp
  FROM location_post 
 WHERE (author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
          OR author_uid = me() 
          OR tagged_uids IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
          OR tagged_uids = me()) 
       AND page_id = 303736809701751


来源:https://stackoverflow.com/questions/17537158/facebook-fql-get-all-posts-at-location

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