Show
Ignore:
Timestamp:
11/07/07 17:34:29 (6 years ago)
Author:
mattn
Message:

lang/perl/Net-Kotonoha/trunk/Net-Kotonoha/lib/Net/Kotonoha/Koto.pm: added title getter for koto.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Net-Kotonoha/trunk/Net-Kotonoha/lib/Net/Kotonoha/Koto.pm

    r1213 r1214  
    7979sub noman { 
    8080    return shift->_get_list('//dl[@id="commentsno"]//ul[@class="commentbox"]', 2); 
     81} 
     82 
     83sub title { 
     84    my $self = shift; 
     85    my $tree = HTML::TreeBuilder::XPath->new; 
     86    $tree->parse( $self->_get_content ); 
     87    $tree->eof; 
     88    my $t = $tree->findnodes('//title'); 
     89    $t = $t ? $t->shift->as_text : undef; 
     90    $tree->delete; 
     91    $t; 
    8192} 
    8293