Changeset 22933

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

move as_tree to Declare.pm

Location:
lang/perl/WWW-MobileCarrierJP/trunk/lib/WWW/MobileCarrierJP
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WWW-MobileCarrierJP/trunk/lib/WWW/MobileCarrierJP/Declare.pm

    r18683 r22933  
    99my $exporter = Sub::Exporter::build_exporter( 
    1010    { 
    11         exports => [qw(parse_one scraper process col)], 
     11        exports => [qw(parse_one scraper process col as_tree)], 
    1212        groups  => { default => [':all'] } 
    1313    }, 
     
    4444        return \@res; 
    4545    }; 
    46  
    4746} 
    4847 
     48sub as_tree { 
     49    my $old = shift; 
     50 
     51    my $tree = HTML::TreeBuilder::XPath->new; 
     52    $tree->parse($old->as_HTML); 
     53    $tree; 
     54} 
     55 
     56 
    49571; 
  • lang/perl/WWW-MobileCarrierJP/trunk/lib/WWW/MobileCarrierJP/DoCoMo/Flash.pm

    r22932 r22933  
    1616        process '//tr[@class="acenter"]', 'models[]', [sub { 
    1717            my $elem = $_; 
    18             my $tree = _as_tree($elem); 
     18            my $tree = as_tree($elem); 
    1919            $_->delete for $tree->findnodes('//td[@class="brownLight acenter middle"]'); 
    2020            $_->delete for $tree->findnodes('//td[@class="acenter middle"]'); 
     
    4343); 
    4444 
    45 sub _as_tree { 
    46     my $self = shift; 
    47  
    48     my $tree = HTML::TreeBuilder::XPath->new; 
    49     $tree->parse($self->as_HTML); 
    50     $tree; 
    51 } 
    52  
    53451; 
    5446__END__