예제 #1
0
 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);
 }
예제 #2
0
 public function testParseForumPages()
 {
     $html = file_get_html("test/forum.html");
     $pages = PtParserCk101::parseForumPages($html);
     //echo $pages;
 }