= $last_modified)
{
header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
exit();
}
}
header('Cache-Control: max-age=86400, public');
header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
header('Last-Modified: ' . gmdate('D, d M Y H:i:s',time() + 86400 ) . ' GMT' );
header('Content-Type: image/jpeg');
echo $marumaru->WEBParsing($imgurl, NULL, NULL);
exit;
}
if(!isset($num))
{
?>
wasabisyrup(marumaru.in) Image URL Parser API
wasabisyrup(marumaru.in) Image URL Parser API
Using: /api/{wasabisyrup number}/{1 or 0(null)}
Use only application/web/other developers.
Example
no json - /api/93 (Himouto Umaru-Chan)
json - /api/93/1 (Himouto Umaru-Chan)
fmaru php porting by hakase - /fmaru
image direct view - /img/93 (Himouto Umaru-Chan)
JSON Type
title : Manga Subject
url : Image URL
explorer : Another same cartoon episode (same episode will be ignored) - id => name (if not data, show null value)
prevnext : Next Episode / Prev Episode (if not data, show null value)
- prev : id => name (or NULL)
- next : id => name (or NULL)
String Type
First Line : Manga Subject
Other Line : Image URL
Error Message
Number 0 : Connect Error (wasabisyrup 403 or other error)
Number 1 : Cookie Send Error (Not applied sucuri cookie data)
Number 2 : Cookie Get Error
Number 3 : Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times)
Number 4 : Not found comics data
Other error : read the message
Output only JSON (Example) {"error":1,"message":"Error Message)"}
Only error / message method use
Etc...
Open Source
Developed by Hakase (contact@hakase.kr)
사용은 자유고 제한 없음. 애초에 제한 있으면 API 인증키를 넣겠지만 귀찮아서 안 넣음.
FileRead();
if(!$dd || explode(PHP_EOL, $dd)[0] < time() || $tmp > 1 || $tmp2 > 3)
{
$cookie = $marumaru->GetCookie();
if(!$cookie) $marumaru->ErrorEcho(2);
$marumaru->FileWrite($cookie);
}
else
$cookie = explode(PHP_EOL, $dd)[1];
startdata:
$caches++;
$data = $marumaru->WEBParsing('http://wasabisyrup.com/archives/'.$num, $cookie);
/*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
{
$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, 'Protected ') !== false)
if($caches > 5)
$marumaru->ErrorEcho(3);
else
{
$tmp2++;
goto startdata;
}
/*if(stripos($data, 'You are being redirected...') !== false)
if($caches > 2)
$marumaru->ErrorEcho(1);
else
{
$tmp++;
goto cookieget;
}*/
$jsonon = ($_GET['json'] == 1) ? true : false;
$aaa = explode('data-src="', str_replace('data-src="/storage/', 'data-src="http://wasabisyrup.com/storage/', $data));
$title = $marumaru->splits($aaa[0], '', ' ');
$title = trim(explode(' | ', $title)[0]);
$data2 = $marumaru->splits($data, '', ' ');
$data2 = explode(' ';
}
else
{
for($i=1;$i', $data2[$i])[0]))
{
if($i != count($data2) - 1)
{
$nextid = trim(explode('" >', $data2[$i+1])[0]);
$nextname = trim(explode(' ', explode('" >', $data2[$i+1])[1])[0]);
}
if($i != 1)
{
$previd = trim(explode('" >', $data2[$i-1])[0]);
$prevname = trim(explode('', explode('" >', $data2[$i-1])[1])[0]);
}
continue;
}
$aac[] = [trim(explode('" >', $data2[$i])[0]) => trim(explode('', explode('" >', $data2[$i])[1])[0])];
}
if($previd || $nextid)
{
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);
echo json_encode($aaaa);
}
else
echo $title.PHP_EOL.implode(PHP_EOL, $aab);
}