From 03857e2e54cbdd565b4a32b8d16b1e3daabaf3c7 Mon Sep 17 00:00:00 2001 From: hakasenyang Date: Sun, 13 Nov 2016 05:58:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 조금 더 보기 편하게 수정. --- index.php | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index abe6bf6..4bcf443 100644 --- a/index.php +++ b/index.php @@ -68,14 +68,21 @@ startdata: $num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4]; $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2); }*/ - if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $marumaru->ErrorEcho(4); - if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0); + if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || + stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) + $marumaru->ErrorEcho(4); + if(stripos($data, 'HTTP/1.1 200 OK') === false) + $marumaru->ErrorEcho(0); if(stripos($data, 'This content is password protected.') !== false) - if($caches > 5) $marumaru->ErrorEcho(3); - else goto startdata; + if($caches > 5) + $marumaru->ErrorEcho(3); + else + goto startdata; if(stripos($data, 'You are being redirected...') !== false) - if($caches > 2) $marumaru->ErrorEcho(1); - else goto cookieget; + if($caches > 2) + $marumaru->ErrorEcho(1); + else + goto cookieget; $jsonon = ($_GET['json'] == 1) ? true : false; $aaa = explode('data-src="', $data); @@ -113,17 +120,26 @@ startdata: } if($previd || $nextid) { - if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null]; - if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null]; + if($previd) + $aad[] = ['prev'=>[$previd=>$prevname]]; + else + $aad[] = ['prev'=>null]; + if($nextid) + $aad[] = ['next'=>[$nextid=>$nextname]]; + else + $aad[] = ['next'=>null]; } for($i=1;$i$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad); + $aaaa = array('title'=>$title, + 'url'=>$aab, + 'explorer'=>$aac, + 'prevnext'=>$aad); echo json_encode($aaaa); } else echo $title.PHP_EOL.implode(PHP_EOL, $aab); - } + } \ No newline at end of file