潘蓝兰

NAME

Novel::Robot::Parser get novel / bbs content from website

小说站点解析引擎

INIT

site

支持小说站点

asxs 爱尚

dddbbb 豆豆

dingdian 顶点

jjwxc 绿晋江

luoqiu 落秋

kanunu 努努

qidian 起点

shunong 书农

snwx 少年文学

支持论坛站点

hjj 红晋江

tieba 百度贴吧

new

初始化解析模块

   my $url = 'http://www.jjwxc.net/onebook.php?novelid=2456';

   #直接指定站点
   my $parser = Novel::Robot::Parser->new( site => 'jjwxc' );
    
   #通过url自动检测站点
   my $parser = Novel::Robot::Parser->new( site => $url );

get_item_ref 获取小说/贴子内容

   my $r = $parser->get_item_ref($url, %opt);

NOVEL FUNCTION

get_novel_ref 获取小说内容

   my $r = $parser->get_novel_ref($url, %opt);

get_index_ref 获取目录页信息

   my $index_ref = $parser->get_index_ref($index_url, %opt);

parse_index 解析目录页

   my $index_ref = $parser->parse_index($index_html_ref);

get_chapter_ref 获取章节页信息

    my $chapter_url = 'http://m.jjwxc.net/book2/2456/2';
    my $chapter_ref = $parser->get_chapter_ref($chapter_url, 2);

parse_chapter 解析章节页

   my $chapter_ref = $parser->parse_chapter($chapter_html_ref);

TIEZI FUNCTION

get_tiezi_ref 获取贴子内容

   my $r = $parser->get_tiezi_ref($url, %opt);

parse_tiezi 获取帖子信息

   my $tz_ref = $parser->parse_tiezi($tz_html_ref);

parse_tiezi_floors 获取帖子楼层

   my $floors = $parser->parse_tiezi_floors($tz_html_ref);

parse_tiezi_urls 获取帖子分页

   my $urls = $parser->parse_tiezi_urls($tz_html_ref);

BOARD FUNCTION

get_board_ref 获取版块信息

   my $r = $parser->get_board_ref($url, %opt);

parse_board 获取版块/作者专栏标题

   my $board_ref = $parser->parse_board($board_html_ref);

parse_board_tiezis 获取版块内容url

   my $tzs = $parser->parse_board_items($board_html_ref);

parse_board_urls 获取版块分页url

   my $urls = $parser->parse_board_urls($board_html_ref);

parse_board_subboards 获取子版块url

   my $subboards = $parser->parse_board_subboards($board_html_ref);

QUERY FUNCTION

get_query_ref 获取查询结果

    my $query_type = '作者';
    my $query_keyword = '顾漫';

    my ($info, $items_ref) = $parser->get_query_ref( $query_keyword, 
        query_type => $query_type );

make_query_request 指定查询请求

  my ($query_url, $post_data) = 
        $parser->make_query_request( $query_keyword, 
        query_type => $query_type );

parse_query 解析查询结果标题

  my $query_title = $parser->parse_query($query_html_ref); 

parse_query_items 解析查询结果列表,例如小说url

  my $items_ref = $parser->parse_query_items($query_html_ref); 

parse_query_urls 查询结果为分页url

  my $urls_ref = $parser->parse_query_urls($query_html_ref);



Hosting generously
sponsored by Bytemark