I'm trying to request more than 100 live channels from the Twitch API. The current limit of results are 100. I need to do a new request every 100 while adding +1 to the offset url. I've tried to search to find help but I haven't been able to find anything.
<?php
$get2 = json_decode
(@file_get_contents_curl('https://api.twitch.tv/kraken/streams/?
offset=0&limit=5'), true);
foreach ($get2['streams'] as $test) {
echo "<pre>";
print_r ($test['channel']['name'] . ' | ' . $test['viewers']);
echo "</pre>";
}
?>
This will echo 100 results perfectly. I just need to loop that code x however many times I need to get to the total. So say there are 30,000 live streams. That will be 300 queries.