mirror of
https://github.com/hakasenyang/marumaru-php-parser
synced 2026-08-22 10:13:08 +09:00
First commit
마루마루 관련 파일입니다.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include_once '_function.php';
|
||||
$marumaru = new Marumaru();
|
||||
$file = $marumaru->FileRead('mangalist.txt');
|
||||
if(!$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');
|
||||
}
|
||||
echo explode(PHP_EOL, $file)[1];
|
||||
exit;
|
||||
Reference in New Issue
Block a user