public function updateBookList($fromPage = 1) { $page = $fromPage; $maxPage = 0; do { $html = PtHttpCk101::getBookListPage($page); $bookList = PtParserCk101::parseBooksFromForum($html); $maxPage = max($maxPage, PtParserCk101::parseForumPages($html)); $this->d("parsing forum page {$page}/{$maxPage}"); $this->updateBookListImpl($bookList); $this->d("update list finish " . count($bookList) . " books"); sleep(self::QUERY_SLEEP); } while (++$page <= $maxPage); }
public function testGetBookListPage() { PtHttpCk101::getBookListPage(1); }