Can retrieve full list of follower ids (700), but get 35% (252) of the user data with user/lookup

nodejs

#1

I’m not sure why this would be the case. The accounts look good as far as I can tell and should have data available. The list of follower ids is accurate and complete, and the user_id’s sent to user/lookup is complete (707 user ids), but I only get 35% of the screen names in response (252).

I logged the length of each FollowerChunk, and it’s definitely not storing all of the data. This is how much data each FollowerChunk had. The chunks should be sets of 100 followed by the remainder after 700, but they’re not. They were as follows.
44, 30, 29, 37, 40, 31, 40, 2

var Twitter = require('twitter');

const fs = require('fs');
const { EOL } = require('os');
const outputStream = fs.createWriteStream('/mnt/server/www/ms/data/redpill/twitter.txt');
const params = {screen_name: 'twitter'};
var res_array = [];
const client = new Twitter({
  consumer_key: '',
  consumer_secret: '',
  access_token_key: '',
  access_token_secret: ''
});

function getUserInfo(id_list) {
    return client.get('users/lookup', {
	    "user_id": id_list
    });
}

client.get('followers/ids', params, function(err, data) {
    if (err) {
	    console.log(err);
	    return;
    }

    let cycle = 0;
    let counter = data.ids.length;
    var requestNum = Math.floor(data.ids.length / 100);
    var remainder = data.ids.length % 100;
    var promises_arr = [];
    console.log("Total: " + counter);

    for (var i = 0; i < requestNum; i++) {
	    promises_arr.push(getUserInfo(data.ids.slice(i * 100, i * 100 + 100).join(",")));
    }
    if (remainder != 0) {
	    promises_arr.push(getUserInfo(data.ids.slice(requestNum * 100, requestNum * 100 + 100).join(",")));
    }

    Promise.all(promises_arr)
	    .then(function(followerChunks) {
		    followerChunks.forEach(function (followerChunk) {
			    followerChunk.forEach(function (follower) {
				    outputStream.write(follower.screen_name + EOL);
				    cycle++;
			    });

			    let percentage = cycle/counter*100 || 0;
			    console.log(`${percentage.toFixed(2)}%`);
		    });
	    })
	    .catch(console.error);
})

#2

This is the followers/id response.

{ ids: 
   [ 934528494637285400,
     979268151996133400,
     945922423408513000,
     956484909144580100,
     858131538998952000,
     77254143,
     945354608947298300,
     976151819327103000,
     968665996507611100,
     1447074931,
     970171037231886300,
     362406254,
     939805584748097500,
     1305806784,
     78543778,
     2394002768,
     931713087190663200,
     3245669550,
     884039798159286300,
     954160982758121500,
     948519611334447100,
     969939216518938600,
     863486495960686600,
     1200652135,
     927190365672693800,
     924628083222626300,
     969142212389879800,
     71467524,
     973429408991072300,
     973747044169994200,
     966288652593713200,
     79733988,
     966525250241421300,
     975422243126652900,
     975421229258571800,
     975420727246577700,
     975419715609813000,
     975419208375853000,
     975411107652251600,
     898959244434620400,
     975405423598608400,
     975404356571865100,
     975403401642065900,
     975402811025276900,
     975359218348732400,
     975352844155940900,
     975351686007894000,
     975350020319846400,
     975348087030886400,
     975347473265827800,
     975346995823984600,
     975344407028285400,
     975343897202143200,
     780033939117215700,
     889295223343521800,
     975333608322814000,
     975332511545901000,
     976588412462489600,
     975210593534685200,
     967469871847100400,
     975209525148926000,
     975201049320435700,
     975213002856153100,
     945075897253503000,
     975213763128250400,
     931821269586030600,
     975214517624844300,
     975258748041089000,
     975262486453604400,
     975263395556442100,
     931817180869443600,
     975264052975779800,
     946981489777958900,
     931810854776873000,
     975265206430412800,
     933912216331362300,
     931809910559457300,
     3371321232,
     975283191245258800,
     931808890492031000,
     975280911687204900,
     931807484725018600,
     931806370373836800,
     975267908036173800,
     951756678130577400,
     931802134344904700,
     951231514418622500,
     975278981812445200,
     943855457554153500,
     2318179022,
     931800787688112100,
     927065863231901700,
     4519331774,
     927062976305160200,
     927060522498846700,
     927057237679292400,
     927055041734762500,
     927052312475877400,
     889250995355516900,
     580693313,
     ... 2299 more items ],
  next_cursor: 0,
  next_cursor_str: '0',
  previous_cursor: 0,
  previous_cursor_str: '0' }