Take a simple FQL query FQL that all links shared by friends of users from yesterday, for example:
SELECT link_id, title, url, owner, created_time FROM link WHERE created_time > strtotime('yesterday') AND owner IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) LIMIT 100
If the user has 50 friends, this will do just fine. But if the user has hundreds of friends, most often Facebook returns an error.
Options:
- Limit friend request to 50 . Of course, this will work, but it will show the same friends every time. If you do not want to use the League chip, this is not very useful.
- Batch requests . Create a query package using offsets and limit them to 50. Unfortunately, there are no improvements.
- Loop It . So far this is the best I have found. Scroll through the same queries that you created for the batch query, but do this one at a time with multiple api fql query calls. But even this is amazing and misses.
How can I request Facebook appropriately to ensure successful results?
Notes:
- I am using the latest php sdk php version 3.1.1
- I also tried expanding the default options for timeouts to hang in the base_facebook.php file
Common timeout errors:
one.
Fatal error: Uncaught Exception: 1: An unknown error occurred thrown in /..../facebook/php-sdk/src/base_facebook.php on line 708
line 708 is an exception error:
if (is_array($result) && isset($result['error_code'])) { throw new FacebookApiException($result); }
2.
Fatal error: Uncaught CurlException: 52: SSL read: error:00000000:lib(0):func(0):reason(0), errno 104 thrown in /..../facebook/php-sdk/src/base_facebook.php on line 814
facebook facebook-fql
Ryan
source share