Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. <?php
  2.  
  3. if ( ! defined( 'HDGSENGINE' ) ) {
  4. die( 'Hacking attempt!' );
  5. }
  6.  
  7.  
  8.  
  9. class com_hitbox{
  10.  
  11. public static function GetAuth($username, $pass) {
  12. $username = htmlentities(urldecode($username));
  13. $pass = htmlentities(urldecode($pass));
  14. $url = 'https://api.hitbox.tv/auth/token';
  15. $data = array('login' => $username, 'pass' => $pass, 'app' => 'Desktop');
  16. $options = array(
  17. 'https' => array(
  18. 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  19. 'method' => 'POST',
  20. 'content' => http_build_query($data),
  21. ),
  22. );
  23. $context = stream_context_create($options);
  24. $result = json_decode(file_get_contents($url, false, $context), true);
  25. echo'GetAuth: ';
  26. print_r($result);
  27. echo'</br>';
  28. return $result['authToken'];
  29. }
  30.  
  31. public static function start() {
  32. $channel='masta';
  33. $count='1';
  34. $user_name='aces';
  35. $authToken='***';
  36.  
  37. $pass='no';
  38. //$authToken=com_hitbox::GetAuth($user_name, $pass);
  39. //echo $authToken;
  40.  
  41. $url = 'https://api.hitbox.tv/ws/combreak/'.$channel.'/'.$count;
  42. $data = array('user_name' => $user_name, 'authToken' => $authToken);
  43.  
  44. $options = array(
  45. 'https' => array(
  46. 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  47. 'method' => 'POST',
  48. 'content' => http_build_query($data)
  49. )
  50. );
  51. $context = stream_context_create($options);
  52. $result = file_get_contents($url, false, $context);
  53. if ($result === FALSE) { /* Handle error */ }
  54.  
  55. var_dump($result);
  56.  
  57.  
  58.  
  59. }
  60.  
  61. }
  62.  
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement