root/lang/perl/WWW-MobileCarrierJP/tags/0.07/lib/WWW/MobileCarrierJP/ThirdForce/PictogramInfo.pm @ 4919

Revision 4919, 1.0 kB (checked in by yappo, 6 years ago)

revert revision 4905, 4906, 4907, 4908, 4909

Line 
1package WWW::MobileCarrierJP::ThirdForce::PictogramInfo;
2use strict;
3use warnings;
4use Web::Scraper;
5use URI;
6
7my @urls = map "http://developers.softbankmobile.co.jp/dp/tool_dl/web/picword_0$_.php", 1..6;
8
9sub scrape {
10    my $res;
11
12    my $emoji = scraper {
13        process '//table[@width="100%" and @cellpadding="2"]//tr/td/font/../..',
14            'emoji[]' => scraper {
15            process '//td[2]/font', unicode => 'TEXT';
16            process '//td[3]/font', sjis => [ 'TEXT', sub { unpack "H*", shift } ];
17            };
18        result 'emoji';
19    };
20
21    foreach my $url (@urls) {
22        push @$res, @{ $emoji->scrape( URI->new($url) ) };
23    }
24
25    $res;
26}
27
281;
29__END__
30
31=head1 NAME
32
33WWW::MobileCarrierJP::ThirdForce::PictogramInfo - get PictogramInfo informtation from ThirdForce site.
34
35=head1 SYNOPSIS
36
37    use WWW::MobileCarrierJP::ThirdForce::PictogramInfo;
38    WWW::MobileCarrierJP::ThirdForce::PictogramInfo->scrape();
39
40=head1 AUTHOR
41
42Tokuhiro Matsuno < tokuhirom gmail com >
43
44=head1 SEE ALSO
45
46L<WWW::MobileCarrierJP>
47
Note: See TracBrowser for help on using the browser.