From 55e4a24de82b50d50039a911cdee75de5bba0142 Mon Sep 17 00:00:00 2001 From: FoxInFlame Date: Mon, 17 Dec 2018 20:51:58 +0900 Subject: [PATCH] Remove unnecessary files from master branch --- .htaccess | 0 anime.recommendations.ID.ID.php | 137 -------------------------------- 2 files changed, 137 deletions(-) delete mode 100644 .htaccess delete mode 100644 anime.recommendations.ID.ID.php diff --git a/.htaccess b/.htaccess deleted file mode 100644 index e69de29..0000000 diff --git a/anime.recommendations.ID.ID.php b/anime.recommendations.ID.ID.php deleted file mode 100644 index 5fee0ff..0000000 --- a/anime.recommendations.ID.ID.php +++ /dev/null @@ -1,137 +0,0 @@ - "The id parameter is not defined." - )); - http_response_code(400); - return; - } - if(empty($id2)) { - echo json_encode(array( - "message" => "Two ids are not defined." - )); - http_response_code(400); - return; - } - if(!is_numeric($id) || !is_numeric($id2)) { - echo json_encode(array( - "message" => "Specified anime id is not a number." - )); - http_response_code(400); - return; - } - - $url = "https://myanimelist.net/recommendations/anime/" . $id . "-" . $id2; - $data = new Data(); // Initialise cache class - - if($data->getCache($url)) { - $html = str_get_html($data->data); - } else { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($ch); - if(!$response) { - echo json_encode(array( - "message" => "MAL is offline." - )); - http_response_code(404); - return; - } - if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 404) { - echo json_encode(array( - "recommendations" => array() - )); - http_response_code(200); - return; - } - curl_close($ch); - - $data->saveCache($url, $response); - $html = str_get_html($response); - } - - if(!is_object($html)) { - echo json_encode(array( - "message" => "The code for MAL is not valid HTML markup." - )); - http_response_code(500); - return; - } - - // [+] ============================================== [+] - // [+] ---------------------------------------------- [+] - // [+] --------------GET/SET THE VALUES-------------- [+] - // [+] ---------------------------------------------- [+] - // [+] ============================================== [+] - - $recommendations = $html->find("#content .borderDark .borderClass"); - $recommendations_arr = array(); - - foreach($recommendations as $recommendation) { - if($recommendation->find(".spaceit_pad", 0)->find("span", 0)) { - $reason = explode("find(".spaceit_pad", 0)->innertext)[0] . $recommendation->find(".spaceit_pad", 0)->find("span", 0)->innertext; - } else { - $reason = explode("find(".spaceit_pad", 0)->innertext)[0]; - } - $author = $recommendation->find(".spaceit_pad", 1)->find("a", 1)->innertext; - array_push($recommendations_arr, array( - "reason" => $reason, - "author" => $author - )); - } - - // [+] ============================================== [+] - // [+] ---------------------------------------------- [+] - // [+] --------------------OUTPUT-------------------- [+] - // [+] ---------------------------------------------- [+] - // [+] ============================================== [+] - - $output = array( - "items" => $recommendations_arr - ); - - // JSON_NUMERIC_CHECK flag requires at least PHP 5.3.3 - echo json_encode($output, JSON_NUMERIC_CHECK); - http_response_code(200); -}); \ No newline at end of file