Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // CREDENTIALS AND INITIALISATION
- $url = 'https://api.twitch.tv/kraken/channels/Harmo801/stream_key';
- $cookies_file = 'cookie.txt';
- if (!file_exists(realpath($cookies_file))) touch($cookies_file);
- // CONNEXION
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/vnd.twitchtv.v3+json", "Authorization: OAuth h2326ng3rjaoa2qeio4ujum03efc8nr"));
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
- //curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies_file);
- //curl_setopt($ch, CURLOPT_COOKIEJAR, realpath($cookies_file));
- $resultat = curl_exec($ch);
- $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- var_dump($http_status);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement