root/lang/perl/Net-CIDR-MobileJP/tags/0.10/lib/Net/CIDR/MobileJP/Scraper.pm @ 4908

Revision 4908, 1.0 kB (checked in by hakobe, 5 years ago)
Line 
1package Net::CIDR::MobileJP::Scraper;
2use strict;
3use warnings;
4use UNIVERSAL::require;
5use WWW::MobileCarrierJP::DoCoMo::CIDR;
6
7my $short_name_for = +{
8    DoCoMo     => 'I',
9    EZWeb      => 'E',
10    AirHPhone  => 'H',
11    ThirdForce => 'V',
12};
13
14sub new { bless {}, shift }
15
16sub run {
17    my ($self, ) = @_;
18
19    my $result;
20    for my $carrier (qw/DoCoMo EZWeb AirHPhone ThirdForce/) {
21        my $class = "WWW::MobileCarrierJP::${carrier}::CIDR";
22        $class->use or die $@;
23        my $dat = $class->scrape;
24        $result->{$short_name_for->{$carrier}} = [map { "$_->{ip}$_->{subnetmask}" } @$dat];
25    }
26    return $result;
27}
28
291;
30__END__
31
32=head1 NAME
33
34Net::CIDR::MobileJP::Scraper - scraping module for mobile ip address in Japan
35
36=head1 SYNOPSIS
37
38    my $data = Net::CIDR::MobileJP::Scraper->new->run;
39
40=head1 DESCRIPTION
41
42scraping module for mobile ip address in Japan.
43
44=head1 AUTHORS
45
46  Tokuhiro Matsuno  C<< <tokuhiro __at__ mobilefactory.jp> >>
47  id:spiritloose
48
49=cut
50
Note: See TracBrowser for help on using the browser.