Changeset 3079 for lang/perl/HTTP-MobileAgent
- Timestamp:
- 12/12/07 09:54:13 (6 years ago)
- Location:
- lang/perl/HTTP-MobileAgent/branches/feature-WWWMobileCarrierJP
- Files:
-
- 3 modified
-
Makefile.PL (modified) (1 diff)
-
bin/makedocomomap (modified) (2 diffs)
-
bin/makexmldocomomap (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAgent/branches/feature-WWWMobileCarrierJP/Makefile.PL
r204 r3079 6 6 'Test::More' => 0.32, 7 7 'HTTP::Headers' => 1.43, 8 'WWW::MobileCarrierJP' => 0.04, 8 9 }, 9 10 ); -
lang/perl/HTTP-MobileAgent/branches/feature-WWWMobileCarrierJP/bin/makedocomomap
r2444 r3079 3 3 use utf8; 4 4 use FindBin; 5 use LWP::Simple;6 5 use Data::Dumper; 7 6 use HTTP::MobileAgent; 8 7 use Encode; 9 8 use File::Spec; 10 11 my $URL = 12 'http://www.nttdocomo.co.jp/service/imode/make/content/spec/screen_area/index.html'; 9 use WWW::MobileCarrierJP::DoCoMo::Display; 13 10 14 11 do_task(@ARGV); 15 12 16 13 sub do_task { 17 my $html = decode( 'cp932', get($URL) ); 18 $html =~ s/(?:\r?\n)+/\n/g; 19 $html =~ s/μ/myu/g; 20 my $re = regexp(); 14 my $dat = WWW::MobileCarrierJP::DoCoMo::Display->scrape; 21 15 my %map; 22 while ( $html =~ /$re/igs ) { 23 my ( $model, $width, $height, $color, $depth ) = ( $1, $2, $3, $4, $5 ); 24 $map{ uc($model) } = { 25 width => $width, 26 height => $height, 27 color => $color eq 'カラー', 28 depth => $depth, 16 for my $phone (@$dat) { 17 $map{ uc $phone->{model} } = +{ 18 width => $phone->{width}, 19 height => $phone->{height}, 20 color => $phone->{is_color}, 21 depth => $phone->{depth}, 29 22 }; 30 23 } … … 86 79 } 87 80 88 sub regexp {89 return <<'RE';90 <td><span class="txt">([A-Z]+\d+\w*\+?).*?</span></td>91 <td><span class="txt">.*?(?:</span></td>)?92 <td><span class="txt">.*?(?:</span></td>)?93 <td><span class="txt">.*?(\d+)×(\d+).*?</span></td>94 <td>.*?</td>95 <td><span class="txt">(白黒|カラー)(?:.*?)(\d+)(?:色|階調)</span></td>96 RE97 } -
lang/perl/HTTP-MobileAgent/branches/feature-WWWMobileCarrierJP/bin/makexmldocomomap
r2444 r3079 3 3 use warnings; 4 4 use utf8; 5 use LWP::Simple;6 5 use XML::Simple (); 7 6 use Encode; 8 9 my $URL = 10 'http://www.nttdocomo.co.jp/service/imode/make/content/spec/screen_area/index.html'; 7 use WWW::MobileCarrierJP::DoCoMo::Display; 11 8 12 9 do_task(@ARGV); 13 10 14 11 sub do_task { 15 my $html = decode( 'cp932', get($URL) ); 16 $html =~ s/(?:\r?\n)+/\n/g; 17 $html =~ s/μ/myu/g; 18 my $re = regexp(); 12 my $dat = WWW::MobileCarrierJP::DoCoMo::Display->scrape; 19 13 my %map; 20 while ( $html =~ /$re/igs ) { 21 my ( $model, $width, $height, $color, $depth ) = ( $1, $2, $3, $4, $5 ); 22 push @{ $map{terminal} }, 23 { 24 model => uc($model), 25 width => $width, 26 height => $height, 27 color => $color eq 'カラー', 28 depth => $depth, 29 }; 14 for my $phone (@$dat) { 15 $map{ uc $phone->{model} } = +{ 16 width => $phone->{width}, 17 height => $phone->{height}, 18 color => $phone->{is_color}, 19 depth => $phone->{depth}, 20 }; 30 21 } 31 22 output_code( \%map ); … … 41 32 } 42 33 43 sub regexp {44 return <<'RE';45 <td><span class="txt">([A-Z]+\d+\w*\+?).*?</span></td>46 <td><span class="txt">.*?(?:</span></td>)?47 <td><span class="txt">.*?(?:</span></td>)?48 <td><span class="txt">.*?(\d+)×(\d+).*?</span></td>49 <td>.*?</td>50 <td><span class="txt">(白黒|カラー)(?:.*?)(\d+)(?:色|階調)</span></td>51 RE52 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)