Vote count:
0
function twitch_follow_channel($user, $channel, $client_id, $access_token) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_URL, 'http://ift.tt/1cqH2p9'.$user.'/follows/channels/'.$channel.'?oauth_token='.$access_token);
$h = 'Client-ID: '.$client_id.', Accept: application/vnd.twitchtv.v3+json, Authorization: OAuth '. $access_token;
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: OAuth '.$access_token,
'Client-ID: '.$client_id,
'Content-Length: '.strlen($h),
'Accept: application/vnd.twitchtv.v3+json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
$r = curl_exec($ch);
$ci = curl_getinfo($ch);
return json_decode($r, true);
}
twitch_follow_channel("", "", "", "");
Would anyone help me with what to put in the variables. I understand the following.
twitch_follow_channel("Channelwhich will be following", "channel too follow", "?, "?");
The two question marks represent the question. Where do I get them from? Is the Auth code the POST data from when you login? Thanks.
asked 16 secs ago
Twitch Follow through API Curl
Aucun commentaire:
Enregistrer un commentaire