mirror of
https://github.com/hakasenyang/marumaru-php-parser
synced 2026-08-22 02:03:08 +09:00
23 lines
885 B
PHP
23 lines
885 B
PHP
<?php
|
|
include_once '_function.php';
|
|
$marumaru = new Marumaru();
|
|
$file = $marumaru->FileRead('mangalist.txt');
|
|
if(!isset($file) || @explode(PHP_EOL, $file)[0] < time())
|
|
{
|
|
$data = $marumaru->WEBParsing('http://marumaru.in/c/1');
|
|
$a = explode('" href="/b/manga/', $data);
|
|
$b = explode('<div width="200"><', $data);
|
|
for($i=1;$i<count($a);$i++)
|
|
{
|
|
$name = strip_tags('<'.explode('</div>', $b[$i])[0]);
|
|
$id = explode('"', $a[$i])[0];
|
|
$c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id];
|
|
}
|
|
$marumaru->FileWrite(json_encode(array('list'=>$c)), 'mangalist.txt');
|
|
//$file = $marumaru->FileRead('mangalist.txt');
|
|
$file = json_encode(array('list'=>$c));
|
|
echo $file;
|
|
exit;
|
|
}
|
|
echo explode(PHP_EOL, $file)[1];
|
|
exit; |