Dalexhd

hitboxstatus.php

Oct 25th, 2017
396
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <?php
  2.  
  3. include_once 'include/config.php';
  4. include_once 'include/ts3admin.class.php';
  5.  
  6. function hitboxstatus()
  7. {
  8.     global $query;
  9.     global $config;
  10.  
  11.     $channels = $query->getElement('data', $query->channelList("-topic"));
  12.     foreach($channels as $channel)
  13.     {
  14.         $check = strpos($channel['channel_topic'], "hitbox=");
  15.         if ($check !== false)
  16.         {
  17.             $rozdzielenie = explode("=", $channel['channel_topic']);
  18.             $login = $rozdzielenie[1];
  19.  
  20.             $usr = curl_init('https://api.hitbox.tv/user/'.$login);
  21.             curl_setopt($usr, CURLOPT_RETURNTRANSFER, true);
  22.             $u = curl_exec($usr);
  23.             curl_close($usr);
  24.             $pleaseUser = json_decode($u);
  25.  
  26.             if($pleaseUser->is_live != 0)
  27.             {
  28.                 $opis = '[center]\n';
  29.                 $opis.= '[size=14][color=orange][b]'.$pleaseUser->user_name.'[/b][/color][/size]\n\n';
  30.                 $opis.= '[B]Status:[/B] [color=green][b]ONLINE[/b][/color]\n';
  31.                 $opis.= '[B]Link do profilu:[/B] [URL=http://hitbox.tv/'.$login.']tutaj[/URL]\n';
  32.                 $opis.= '[B]Followy:[/B] '.$pleaseUser->followers.'\n';
  33.                 $opis.= '\n[/center]';
  34.             }
  35.             else
  36.             {
  37.                 $opis = '[center]\n';
  38.                 $opis.= '[size=14][color=orange][b]'.$pleaseUser->user_name.'[/b][/color][/size]\n\n';
  39.                 $opis.= '[B]Status:[/B] [color=red][b]OFFLINE[/b][/color]\n';
  40.                 $opis.= '[B]Link do profilu:[/B] [URL=http://hitbox.tv/'.$login.']tutaj[/URL]\n';
  41.                 $opis.= '[B]Followy:[/B] '.$pleaseUser->followers.'\n';
  42.                 $opis.= '\n[/center]';
  43.             }
  44.  
  45.             $query->channelEdit($channel['cid'], array(
  46.                 'channel_description' => $opis
  47.             ));
  48.         }
  49.     }
  50.     unset($query);
  51.     unset($config);
  52. }
  53. ?>
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment