2014-02-26 68 views
0

我正在使用FQL來運行FB喜歡的查詢,但分頁似乎很奇怪。第一個查詢運行如下捕獲多達400個like_urls:FB FQL極限分頁無法正常工作(表演奇怪)

SELECT url from url_like where user_id='FB_USER_ID' LIMIT 0, 400 

它在本例中返回約25個URL的列表。問題是,我有這個循環的情況下,他們有超過400這個循環中如下查詢可以再次運行:

SELECT url from url_like where user_id='FB_USER_ID' LIMIT 25, 400 

的結果是一樣的25個網址...不應該限制25400忽略每個FQL的前25個?我用來打破我的循環的機制是如果返回的結果總計爲0,所以這是目前把我的查詢進入循環,它只是超時。

任何有關FDB FQL限制如何工作的指針或信息,或者爲什麼LIMIT對於like_url無法正常工作,我們將不勝感激。第5次迭代的當前查詢我的

例子(顯示即使是在結果不一致的數字雖然URL列表出現相同)

02-26-2014 08:03:33 - **** Running pass 1 to get likes for FB UID FB_USER_ID **** 
02-26-2014 08:03:33 - **** Likes pass 1 URL Query: SELECT url from url_like where user_id=FB_USER_ID ORDER BY url ASC LIMIT 0, 400 **** 
02-26-2014 08:03:33 - **** pass 1 had 25 URLs for FB UID FB_USER_ID **** 

02-26-2014 08:03:33 - **** Running pass 2 to get likes for FB UID FB_USER_ID **** 
02-26-2014 08:03:33 - **** Likes pass 2 URL Query: SELECT url from url_like where user_id=FB_USER_ID ORDER BY url ASC LIMIT 25, 400 **** 
02-26-2014 08:03:33 - **** pass 2 had 22 URLs for FB UID FB_USER_ID **** 

02-26-2014 08:03:33 - **** Running pass 3 to get likes for FB UID FB_USER_ID **** 
02-26-2014 08:03:33 - **** Likes pass 3 URL Query: SELECT url from url_like where user_id=FB_USER_ID ORDER BY url ASC LIMIT 47, 400 **** 
02-26-2014 08:03:33 - **** pass 3 had 20 URLs for FB UID FB_USER_ID **** 

02-26-2014 08:03:33 - **** Running pass 4 to get likes for FB UID FB_USER_ID **** 
02-26-2014 08:03:33 - **** Likes pass 4 URL Query: SELECT url from url_like where user_id=FB_USER_ID ORDER BY url ASC LIMIT 67, 400 **** 
02-26-2014 08:03:33 - **** pass 4 had 19 URLs for FB UID FB_USER_ID **** 

02-26-2014 08:03:33 - **** Running pass 5 to get likes for FB UID FB_USER_ID **** 
02-26-2014 08:03:33 - **** Likes pass 5 URL Query: SELECT url from url_like where user_id=FB_USER_ID ORDER BY url ASC LIMIT 86, 400 **** 
02-26-2014 08:03:33 - **** pass 5 had 19 URLs for FB UID FB_USER_ID **** 

回答

1

FQL顯示你只有你可以看到網址..例如,我有10個喜好,但第3被隱藏因爲某些原因:

[0] Hidden 
[1] Hidden 
[2] Hidden 
[3] Public 
[4] Public 
... 
[9] Public 

這FQL查詢

SELECT url from url_like where user_id='FB_USER_ID' LIMIT 0, 10 

只會返回7條記錄(公衆)..同樣會happend與

SELECT url from url_like where user_id='FB_USER_ID' LIMIT 3, 10 

SELECT url from url_like where user_id='FB_USER_ID' LIMIT 100 

解決的辦法是讓你知道你必須有多少記錄指望計算所有喜歡。 ..但是 Facebook FQL沒有實現「計數」功能。

所以不存在這個問題,據我所知

真正的解決方案