Changeset 728

Show
Ignore:
Timestamp:
10/26/07 08:26:11 (6 years ago)
Author:
tokuhirom
Message:

lang/perl/WWW-CommentGetter: scrape ameblo comment author info.

Location:
lang/perl/WWW-CommentGetter/trunk/WWW-CommentGetter
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WWW-CommentGetter/trunk/WWW-CommentGetter/lib/WWW/CommentGetter/Plugin/Ameblo.pm

    r691 r728  
    1212 
    1313    my $ret = scraper { 
    14         process 'p.comment_body', 'bodies[]' => 'TEXT'; 
     14        process 'div.each_comment', 'bodies[]' => scraper { 
     15            process 'p.comment_body', 'body' => 'TEXT'; 
     16            process 'span.comment_author', 'author' => 'TEXT'; 
     17        }; 
    1518    }->scrape(URI->new($url)); 
    1619 
    17     return [ 
    18         map { +{ body => $self->trim($_) } } @{ $ret->{bodies} } 
    19     ]; 
     20    return $ret->{bodies}; 
    2021} 
    2122 
  • lang/perl/WWW-CommentGetter/trunk/WWW-CommentGetter/t/01_basic.t

    r699 r728  
    4040--- expected 
    4141-  
     42  author: ☆真理☆ 
    4243  body: 番組視ましたょ社長の紹介ブログも良いけどたまには御自身の事も書いて下さい 
    4344- 
     45  author: KOTORI 
    4446  body: きれいでした!このブログでまた登場していただけることを期待してます笑 
    4547