Search code examples
phpcurltwitch

Twitch API - Fail in the user request


Everything in the PHP code is correct (I checked myself) and there is no error from curl, but the result is always an empty variable (No true/false).

public function prepareUser() {
$url = $this->TwitchAPI->endUrl("USERT");
$temp = curl_init();
curl_setopt($temp, CURLOPT_URL, $url);
curl_setopt($temp, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($temp, CURLOPT_HEADER, array("Authorization" => "OAuth " . $this->access_token));
curl_setopt($temp, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($temp, CURLOPT_SSL_VERIFYPEER, false);
$ret = curl_exec($temp);
if (curl_errno($temp)) {
die("Error - " . curl_error($temp));
}
curl_close($temp);

$this->user = json_decode($ret);
}

Solution

  • Anyone and everyone can use this interface as a platform to grab information from Twitch and post information to Twitch. All needed information is provided on the GIT itself, and is available with only 1 restriction, that you not redistribute the platform (For several security reasons). The GIT is also a good way to get help when needed, as I check it daily. Enjoy and have fun deving!

    https://github.com/IBurn36360/Twitch_Interface