daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BLOCKSIZE = 2000;
  2. MAXATTEMPTS = 10;
  3.  
  4. var query = function (n) {
  5.   return 'SELECT owner, aid FROM album WHERE owner IN (SELECT uid1 FROM friend WHERE uid2 = me()) OR owner = me() ORDER BY aid LIMIT 2000 OFFSET ' +  (BLOCKSIZE * n);
  6. }
  7.  
  8. var resultSize = BLOCKSIZE;
  9. var i = 0;
  10.  
  11. while (resultSize == BLOCKSIZE && i < MAXATTEMPTS) {
  12.   FB.api({
  13.     method: 'fql.query'
  14.   , query: query(i)
  15.   , function (response) {
  16.     resultSize = response.numberOfRecordsOrWhatever;
  17.     [ .... ]
  18.   });
  19.   i++;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top