How to get mutual facebook likes between users who are using an app

房东的猫 提交于 2019-12-04 06:23:33

This can be achieved via FQL.

1) Select the pages of user 1

SELECT page_id FROM page_fan WHERE uid = $user1

2) Select the pages of user 2, and use the page_id's from the previous query as another filter (aka - a sub query)

Which gives you a final complete query that accomplishes this:

SELECT page_id FROM page_fan WHERE uid= $user2 AND page_id IN (SELECT page_id FROM page_fan WHERE uid = $user1)

FQL ain't available anymore. You can do it with the graph API from facebook. Something like this :

graph.setAccessToken(user.facebookToken);
  graph.get("/"+targetFacebookId+"?fields=context", null,  function(err, result) {
    if (err) {
      notDoStuff(err);
    } else {
      doStuff(result);
    }
  });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!