Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! defined( 'HDGSENGINE' ) ) {
- die( 'Hacking attempt!' );
- }
- class com_hitbox{
- public static function GetAuth($username, $pass) {
- $username = htmlentities(urldecode($username));
- $pass = htmlentities(urldecode($pass));
- $url = 'https://api.hitbox.tv/auth/token';
- $data = array('login' => $username, 'pass' => $pass, 'app' => 'Desktop');
- $options = array(
- 'https' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'POST',
- 'content' => http_build_query($data),
- ),
- );
- $context = stream_context_create($options);
- $result = json_decode(file_get_contents($url, false, $context), true);
- echo'GetAuth: ';
- print_r($result);
- echo'</br>';
- return $result['authToken'];
- }
- public static function start() {
- $channel='masta';
- $count='1';
- $user_name='aces';
- $authToken='***';
- $pass='no';
- //$authToken=com_hitbox::GetAuth($user_name, $pass);
- //echo $authToken;
- $url = 'https://api.hitbox.tv/ws/combreak/'.$channel.'/'.$count;
- $data = array('user_name' => $user_name, 'authToken' => $authToken);
- $options = array(
- 'https' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'POST',
- 'content' => http_build_query($data)
- )
- );
- $context = stream_context_create($options);
- $result = file_get_contents($url, false, $context);
- if ($result === FALSE) { /* Handle error */ }
- var_dump($result);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement