简体   繁体   English

使用Open Graph / FQL从Facebook墙检索帖子和评论

[英]Retrieve posts and comments from Facebook wall with Open Graph/FQL

I am finding many difficults while trying to do a rather simple task using facebooks' api (FQL and Open graph). 在尝试使用facebook的api(FQL和Open graph)来完成一个相当简单的任务时,我发现许多困难。
The task is what the title says getting post-list and relative comments from a user wall i tried via FQL and open graph without results : 任务就是标题所说的,我通过FQL尝试从用户墙上获取列表和相关评论,并打开了没有结果的图形:

Approach 1) open graph 方法1)打开图
simple me/feed query returns almost what I want but it includes self-references results such as 简单的我/提要查询几乎返回了我想要的内容,但它包含诸如以下内容的自引用结果

{
  "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"
},

and i cant seem to find what to filter to exclude those records or if i am supposed to filter on my end 而且我似乎无法找到要过滤的内容以排除这些记录,或者如果我应该过滤我的末端

Approach 2) With this query in FQL 方法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)"}

i get my own posts but not post made by others and also the limit clause works in mysterious way from what i have read around. 我得到了自己的帖子,但没有别人发表的帖子,而且从我所读到的内容中,limit条款以一种神秘的方式起作用。
I have used twitter api's without a single problem,i cant believe i have to go through all this mess for a simple request. 我已经使用了twitter api,没有一个单一的问题,我不敢相信我必须经历所有这些混乱才能提出一个简单的请求。

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 您需要输入type ='newsfeed',然后弹出您朋友发布的帖子,就像在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 http://fbdevwiki.com/wiki/FQL:stream

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM