Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
support for 0.11.0+; closes #8 & #11
Browse files Browse the repository at this point in the history
  • Loading branch information
ebencollins committed Dec 12, 2017
1 parent 014b41c commit b01888a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion SinusBot-Stream/sinusbot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ public function getWebStream($instanceUUID = NULL) {
$token = $this->getWebStreamToken($instanceUUID);
if ($token == NULL) return NULL;

return $this->apiURL.'/bot/i/'.$instanceUUID.'/stream/'.$token;
return $this->apiURL.'/b/bot/i/'.$instanceUUID.'/stream/'.$token;
}


Expand Down
14 changes: 1 addition & 13 deletions SinusBot-Stream/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,7 @@ function returns404($url){

function resolveURL($url){
try{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch,CURLOPT_HEADER,true); // Get header information
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,false);
$header = curl_exec($ch);
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header)); // Parse information

for($i=0;$i<count($fields);$i++){
if(strpos($fields[$i],'Location') !== false){
$url = str_replace("Location: ","",$fields[$i]);
}
}
#removed functionality for now. Might need to readd in the future
return $url;
}catch(Exception $e){
return false;
Expand Down

0 comments on commit b01888a

Please sign in to comment.