function getChapterPageList($url = '') { $url = trim($url); $content = fetch_url_content($url); if (!$content) { return false; } }
function get_chapters_from_mangapanda($config = array()) { $chapters_url = trim(__ARRAY_VALUE($config, 'chapters_url', '')); if ($chapters_url == '') { return false; } $content = fetch_url_content($chapters_url); if (!$content) { return false; } $slug = __ARRAY_VALUE($config, 'slug'); preg_match_all('%<a.*?href="(/' . $slug . '/[^"]+)".*?>(.*?)</a>%sim', $content, $result, PREG_PATTERN_ORDER); $urls = $result[1]; $titles = $result[2]; $chapters = array(); for ($i = 0; $i < count($urls); $i += 1) { $url = $urls[$i]; if (preg_match('%^/' . $slug . '/(.*?)$%sim', $url, $regs)) { $chapter_id = $regs[1]; $chapters[$chapter_id] = array('url' => 'http://www.mangapanda.com' . $url, 'title' => $titles[$i]); } } ksort($chapters, SORT_NUMERIC); return $chapters; }