2012-03-13 76 views
0

所以我想从用户家里流 但我希望它有特定的URL链接一样输入后“其中的链接URL = example.com”首页Feed中获取特定链接

因此,我将有一个我的朋友谁共享该链接的数据。

首先我想询问家里有

https://graph.facebook.com/me/home?q=example(工作,但部分,只有旧文章)

然后我做:

friends_id = [Get all ids] 
[foreach friends_id as id] 

    make facebook api call to that id 
    get all links that user had shared 
    [foreach links as link] 

     filter all of them for a specific link   
     [if shared the link] save user to an array 

,那是真慢! 6秒为一个人

最后,我试图用 fql使用流和流过滤器。但问题我可以得到的职位,但我无法查询什么是链接

打印阵列给我:

 [post_id] => ********** 
     [actor_id] => ******* 
     [target_id] => 
     [message] => 
     [action_links] => 
     [type] => 80 

那么,怎样才能实现我有我的数据阵列的目标,我的谁分享了这个链接的朋友?

回答

0

对不起,仅可以通过使用 friends_id = [获取所有ID] [的foreach friends_id作为ID]

make facebook api call to that id 
get all links that user had shared 
[foreach links as link] 

    filter all of them for a specific link   
    [if shared the link] save user to an array 
+1

我想,方法与两个FQL和图形API和FQL显得有点快但Facebook响应时间很糟糕。每个用户需要3-6秒才能获得链接。 5 * 350表示30分钟。 有什么可以让它更快? – 2012-03-13 23:15:26

相关问题