root/lang/perl/WWW-CommentGetter/trunk/WWW-CommentGetter/lib/WWW/CommentGetter/Plugin/Nowa.pm @ 1930

Revision 1930, 0.5 kB (checked in by tokuhirom, 5 years ago)

WWW-CommentGetter: refactoring!

Line 
1package WWW::CommentGetter::Plugin::Nowa;
2use strict;
3use warnings;
4use utf8;
5use Web::Scraper;
6use WWW::CommentGetter::Plugin;
7
8sub run {
9    my ($self, $url) = @_;
10
11    scrape_by_siteinfo $url => {
12        url        => '^http://[^/.]+\.nowa\.jp/.*',
13        context    => 'id("comment")/dl[@class="article-comment"]',
14        attributes => {
15            author => '//dd[@class="comment-author-name"]',
16            date   => '//dd[@class="comment-author-day"]',
17            body   => '//dd[@class="comment-body"]',
18        }
19    };
20}
21
221;
Note: See TracBrowser for help on using the browser.