0

在尝试使用 facebooks 的 api(FQL 和 Open graph)完成一项相当简单的任务时,我发现了很多困难。
任务就是标题所说的从我通过 FQL 尝试的用户墙获取帖子列表和相关评论并打开没有结果的图表:

方法 1) open graph
simple me/feed 查询几乎返回了我想要的,但它包括自引用结果,例如

{
  "id": "1614018744_10200682419255581", 
  "from": {
    "name": "Franco Martinelli", 
    "id": "1614018744"
  }, 
  "story": "\"UNO\" on his own status.", 
  "privacy": {
    "value": ""
  }, 
  "type": "status", 
  "created_time": "2013-06-16T13:49:58+0000", 
  "updated_time": "2013-06-16T13:49:58+0000"
},

而且我似乎找不到要过滤的内容以排除这些记录,或者我是否应该最终过滤

方法 2) 在 FQL 中使用此查询

{"q1":"SELECT post_id, actor_id,target_id, message FROM stream 
WHERE source_id=me() 
AND type in (46,56,80,128,247) AND created_time < 1371254400 LIMIT 250",
"q2":"SELECT text from comment where post_id IN (SELECT post_id FROM #q1)"}

我有自己的帖子,但没有其他人的帖子,而且从我读过的内容来看,限制条款以神秘的方式起作用。
我使用 twitter api 没有任何问题,我不敢相信我必须通过所有这些混乱来完成一个简单的请求。

4

1 回答 1

0

Here are the two queries. You need to include type = 'newsfeed' then that would bring up posts made by your friends,just like your news feed on facebook.com

getpost: ("SELECT actor_id, created_time, likes, post_id, message FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden = 0"),
users: ("SELECT id, name, url, pic FROM profile WHERE id IN (SELECT actor_id FROM #getpost)")

http://fbdevwiki.com/wiki/FQL:stream

于 2013-07-07T14:48:44.443 回答