Open ttptracker opened 11 months ago
@ttptracker try it like this and see if it works for you
const mainpage = await threadsAPI.getUserFollowers('userID');
console.log(mainpage.next_max_id);
const threads = await threadsAPI.getUserFollowers('userID', {
maxID: mainpage.next_max_id,
});
console.log(JSON.stringify(threads));
or also like this
const { users, next_max_id: cursor } = await threadsAPI.getUserFollowers(userID);
console.log(JSON.stringify(users));
if (cursor) {
const threads = await threadsAPI.getUserFollowers(userID, {
maxID: cursor,
});
console.log(JSON.stringify(threads));
}
@ttptracker try it like this and see if it works for you
const mainpage = await threadsAPI.getUserFollowers('userID'); console.log(mainpage.next_max_id); const threads = await threadsAPI.getUserFollowers('userID', { maxID: mainpage.next_max_id, }); console.log(JSON.stringify(threads));
or also like this
const { users, next_max_id: cursor } = await threadsAPI.getUserFollowers(userID); console.log(JSON.stringify(users)); if (cursor) { const threads = await threadsAPI.getUserFollowers(userID, { maxID: cursor, }); console.log(JSON.stringify(threads)); }
Thanks for the help. I tried that but still was not able to get the pagination working. This is what it returns for me
Does anyone know why the API doesn't return next_max_id for me?
I've attached a screenshot of what it returns.
Thank you for your time.