Is there a way to loop through the json pages with the pagination ? This may be a little bit off topic, but at this point I have no one to turn to. My code so far:
$channelsApi = 'https://api.twitch.tv/helix/users/follows?
to_id='.$rid.'&first=100';
$channelName = '';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer ".$_GET['fragmentaccess_token'].""
),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $channelsApi . $channelName
));
$response = curl_exec($ch);
curl_close($ch);
// echo $response;
$json = json_decode($response, true);
I was able to make it through other pages if i simply
foreach ($json['pagination'] as $curs){
if(isset($curs) && $json['data'] != NULL){
// $connection = new mysqli("localhost","root","","twitchun");
$channelsApi = 'https://api.twitch.tv/helix/users/follows?
to_id='.$rid.'&first=100&after='.$curs;
But i do not want to copy paste my code a million times if i have to go through a million names. Thank you in advance !