Changeset 6942 for lang/perl/Net-CIDR-MobileJP
- Timestamp:
- 02/19/08 21:59:14 (5 years ago)
- Location:
- lang/perl/Net-CIDR-MobileJP/trunk
- Files:
-
- 1 removed
- 1 modified
-
lib/Net/CIDR/MobileJP/Scraper.pm (deleted)
-
net-cidr-mobilejp-scraper.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Net-CIDR-MobileJP/trunk/net-cidr-mobilejp-scraper.pl
r2626 r6942 2 2 use strict; 3 3 use warnings; 4 use Getopt::Long; 5 use UNIVERSAL::require; 6 use Pod::Usage; 4 7 5 use YAML; 8 6 9 my $module = 'Net::CIDR::MobileJP::Scraper'; 10 GetOptions( 11 'module=s' => \$module, 12 ) or pod2usage(2); 13 $module->use or die $@; 7 use WWW::MobileCarrierJP::DoCoMo::CIDR; 8 use WWW::MobileCarrierJP::EZWeb::CIDR; 9 use WWW::MobileCarrierJP::AirHPhone::CIDR; 10 use WWW::MobileCarrierJP::ThirdForce::CIDR; 14 11 15 print YAML::Dump($module->new->run); 12 &main;exit; 13 14 sub short_name_for { 15 my $carrier = shift; 16 +{ 17 DoCoMo => 'I', 18 EZWeb => 'E', 19 AirHPhone => 'H', 20 ThirdForce => 'V', 21 }->{$carrier}; 22 } 23 24 sub scrape { 25 my $result; 26 for my $carrier (qw/DoCoMo EZWeb AirHPhone ThirdForce/) { 27 my $class = "WWW::MobileCarrierJP::${carrier}::CIDR"; 28 my $dat = $class->scrape; 29 $result->{short_name_for($carrier)} = [map { "$_->{ip}$_->{subnetmask}" } @$dat]; 30 } 31 return $result; 32 } 33 34 sub main { 35 print YAML::Dump(scrape()); 36 } 16 37 17 38 __END__ … … 21 42 $ net-cidr-mobilejp-scraper.pl 22 43 23 Options:24 --module=Net::CIDR::MobileJP::Scraper::Plugin::EZweb25 26 44 =head2 DESCRIPTION 27 45
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)