Files
marumaru-php-parser/mangalist.php
T
hakasenyang f222156c55 First commit
마루마루 관련 파일입니다.
2016-11-02 08:51:06 +09:00

20 lines
691 B
PHP

<?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;