diff --git a/app/SupportedApps/Tautulli.php b/app/SupportedApps/Tautulli.php new file mode 100644 index 00000000..fc22c5ad --- /dev/null +++ b/app/SupportedApps/Tautulli.php @@ -0,0 +1,77 @@ +buildRequest('arnold'); + switch($res->getStatusCode()) { + case 200: + $data = json_decode($res->getBody()); + if(isset($data->error) && !empty($data->error)) { + echo 'Failed: '.$data->error; + } else { + echo 'Successfully connected to the API'; + } + break; + case 401: + echo 'Failed: Invalid credentials'; + break; + case 404: + echo 'Failed: Please make sure your URL is correct and that there is a trailing slash'; + break; + default: + echo 'Something went wrong... Code: '.$res->getStatusCode(); + break; + } + } + public function executeConfig() + { + $html = ''; + $active = 'active'; + $res = $this->buildRequest('get_activity'); + $data = json_decode($res->getBody()); + $stream_count = $data->response->data->stream_count; + + $html = ' +