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) |
|---|
| Line | |
|---|---|
| 1 | package WWW::CommentGetter::Plugin::Nowa; |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use utf8; |
| 5 | use Web::Scraper; |
| 6 | use WWW::CommentGetter::Plugin; |
| 7 | |
| 8 | sub 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 | |
| 22 | 1; |
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)