| WWW-Mixi-Scraper documentation | Contained in the WWW-Mixi-Scraper distribution. |
WWW::Mixi::Scraper::Plugin::ListComment
This is equivalent to WWW::Mixi->parse_list_comment().
returns an array reference of
{
subject => 'comment extract',
name => 'someone',
link => 'http://mixi.jp/view_diary.pl?id=xxxx',
time => 'yyyy-mm-dd hh:mm'
}
Kenichi Ishigaki, <ishigaki at cpan.org>
Copyright (C) 2007 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| WWW-Mixi-Scraper documentation | Contained in the WWW-Mixi-Scraper distribution. |
package WWW::Mixi::Scraper::Plugin::ListComment; use strict; use warnings; use WWW::Mixi::Scraper::Plugin; validator {qw( id is_number )}; sub scrape { my ($self, $html) = @_; my %scraper; $scraper{comments} = scraper { process 'dl>dd', string => 'TEXT'; process 'dl>dd>a', link => '@href', subject => 'TEXT'; process 'dl>dt', time => 'TEXT'; result qw( string time link subject ); }; $scraper{list} = scraper { process 'div.listCommentArea>ul.entryList01>li', 'comments[]' => $scraper{comments}; result qw( comments ); }; return $self->post_process( $scraper{list}->scrape(\$html) => \&_extract_name ); } 1; __END__