2012-03-13 75 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

相關問題