使用facebook api获取朋友状态更新和评论

时间:2012-06-22 12:19:46

标签: facebook facebook-graph-api facebook-c#-sdk facebook-fql

您好我使用facebook api

我希望根据以下条件获取好友状态

Get all the friends details (name, uid, status_message, posted_date) whose status update has more than 15 comments/likes 

以下查询为所有朋友提供状态更新

 SELECT status_id, uid , message FROM status WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())

以上查询返回我所有的朋友更新,但我想在回复中包含评论和喜欢这些更新,以便我可以查看我身边的点数

api中也有注释表和喜欢的表可能与status_id列有外键关系

我们可以使用SQL

等联接编写完整查询吗?

1 个答案:

答案 0 :(得分:2)

您不能在FQL中执行JOIN,但您可以使用多个查询来近似它们:

{
  'status': 'SELECT status_id, uid , message FROM status 
         WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())',
  'comments': 'SELECT post_id, fromid, time, text FROM comment 
         WHERE post_id IN (SELECT status_id from #status)'
}