家庭饲料获得特定的链接

时间:2012-03-13 23:03:32

标签: facebook-graph-api filter stream facebook-fql

所以我想从用户主流中获取链接类型的帖子 但我希望它有特定的网址,例如“where link url = example.com”

因此,我将获得分享该链接的朋友的数据。

首先,我尝试用

查询房屋

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

那么我怎样才能实现我的朋友分享该链接的一系列数据的目标呢?

1 个答案:

答案 0 :(得分:0)

抱歉,只能使用 friends_id = [获取所有ID] [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