Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. function __construct($id, $auth) {
  2. $this->location = "http://5.178.83.92/".$this->authID."/".$this->authKey."/";
  3. }
  4.  
  5.     function getCurl($url) {       
  6.         $ch = curl_init(); 
  7.        
  8.         curl_setopt($ch, CURLOPT_URL, $this->location.$url);
  9.         curl_setopt($ch, CURLOPT_PROXY, $this->proxy);
  10.         curl_setopt($ch, CURLOPT_HEADER, false);
  11.         curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  12.         $query = curl_exec($ch);
  13.            
  14.         if($query === false) {
  15.             $this->addLog('curl', curl_error($ch));
  16.            
  17.             return $this->sendError(curl_error($ch));
  18.         } else return $query;
  19.        
  20.         curl_close($ch);       
  21.     }
  22.  
  23.     function bossInfo() {
  24.         $url = json_decode($this->getCurl($this->location.'get_boss?ts='.time()), true);
  25.        
  26.         $bossInfo['FinishTime'] =   $url['finish_time'];
  27.         $bossInfo['BossHP'] =       $url['boss_health'];
  28.  
  29.         return $bossInfo;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement