First commit

마루마루 관련 파일입니다.
This commit is contained in:
hakasenyang
2016-11-02 08:51:06 +09:00
committed by GitHub
parent d75ab3c422
commit f222156c55
13 changed files with 71131 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
include_once '_function.php';
$marumaru = new Marumaru();
$data = $marumaru->WEBParsing('http://marumaru.in/'.$_GET['href']);
$data = str_replace('class="con_link" ', 'target="_blank" ', $data);
$thumb = $marumaru->splits($data, '<meta property="og:image" content="', '"');
$a = explode('<a target="_blank" href="', $data);
for($i=1;$i<count($a);$i++)
{
$href = explode('/', explode('"', $a[$i])[0])[4];
$title = str_replace('&nbsp;', ' ', strip_tags('<a target="_blank" href="'.explode('</a>', $a[$i])[0]));
if(!$title) continue;
$episodes[] = ['href'=>$href, 'title'=>$title];
}
echo json_encode(array('cover'=>$thumb, 'episodes'=>$episodes));