yeah, making changes here and there but still can’t have this thing to work, most of the time what happens is that never stops filing the list , even if i use my name when i follow less than 100, i think i need other tip here
this is basically what i do, would need to know if any of these concepts are wrong
my first request is
https://api.twitch.tv/helix/users/follows?from_id=' + localStorage.getItem("usernameID") + '&first=100'
i use 100 that is the max so later i can have the rest with the minimum amount of requests
i get “usernameID” from an earlier request
i have the response in a respuesta2 variable
respuesta2 = JSON.parse(following_req.responseText) ;
i list the first items, no issue so far
then at the end of this first request
paginacion = respuesta2.pagination.cursor ;
i define this new variable paginacion outside of the on button click event function and have all my requests inside, so that variable should be global and exists for the 2 requests, i think
from what i see in the example response the cursor seems to be the one i need ? ( doubt 1 )
then i have the second request in this loop
while ( paginacion != null )
( doubt 2 ) , is that what i should check, that the X.pagnation.cursor is not empty or i have to check that in other way ? )
my second request is
'https://api.twitch.tv/helix/users/follows?from_id=' + localStorage.getItem("usernameID") + '&after=' + paginacion
this time not using the “first” parameter but the “after” one with the cursor
so that it is, from what i understand of this pagination thing ( new to me so is not much ) this should be the way, but still it is not working like should …
i added this text and a counter at the start of the line to testing purposes , the ones with (part 1) is from the first request with the first 100 , then the ones with (part 2) from the second request with the after parameter
here after the 23 ( the ones i follow ) starts again from the number 1 , and stops at the 250) , kind of weird and random number to stop ? don’t know what to change anymore , any idea ?
