I’ve gotten my follower count to pull from the helix API, How would I go about getting sub, total views and bits count to pull.
Here is my follower count code:
<?php
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: xxxxxxxxxxxxxxxxxxxxxxxxx'
));
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$url = 'https://api.twitch.tv/helix/users/follows?to_id=280137643';
$json_array = json_decode(file_get_contents_curl($url), true);
echo $json_array['total']; ?>
Thanks