![]() |
![]()
| ![]() |
![]()
NAMEHTTP::MobileAgent - HTTP mobile user agent string parser SYNOPSISuse HTTP::MobileAgent; # from PSGI $env hash: my $agent = HTTP::MobileAgent->new( $env ); # from %ENV (CGI mode): my $agent = HTTP::MobileAgent->new(); # from Apache (mod_perl 1.x): my $agent = HTTP::MobileAgent->new(Apache->request); # from a HTTP::Headers / HTTP::Request object: my $agent = HTTP::MobileAgent->new( HTTP::Headers->new( ... ) ); my $agent = HTTP::MobileAgent->new( HTTP::Request->new( ... ) ); # from a raw user agent string: my $agent = HTTP::MobileAgent->new($agent_string); if ($agent->is_docomo) { # or if ($agent->name eq 'DoCoMo') # or if ($agent->isa('HTTP::MobileAgent::DoCoMo')) # it's NTT DoCoMo i-mode. # see what's available in H::MA::DoCoMo } elsif ($agent->is_vodafone) { # it's Vodafone(J-Phone). # see what's available in H::MA::Vodafone } elsif ($agent->is_ezweb) { # it's KDDI/EZWeb. # see what's available in H::MA::EZweb } else { # may be PC # $agent is H::MA::NonMobile } my $display = $agent->display; # HTTP::MobileAgent::Display if ($display->color) { ... } DESCRIPTIONHTTP::MobileAgent parses HTTP_USER_AGENT strings of (mainly Japanese) mobile HTTP user agents. It'll be useful in page dispatching by user agents. METHODSHere are common methods of HTTP::MobileAgent subclasses. More agent specific methods are described in each subclasses. Note that some of common methods are also overrided in some subclasses.
WARNINGSFollowing warnings might be raised when $^W is on.
NOTE
MORE IMPLEMENTATIONSIf you have any idea / request for this module to add new subclass, I'm open to the discussion or (more preferable) patches. Feel free to mail me. OTHER LANGUAGE BINDINGSThis module is now ported to PHP as Net::UserAgent::Mobile by Atsuhiro KUBO. See http://pear.php.net/package-info.php?pacid=180 for details. AUTHORTatsuhiko Miyagawa <miyagawa@bulknews.net> is the original author and wrote almost all the code. with contributions of Satoshi Tanimoto <tanimoto@cpan.org> and Yoshiki Kurihara <kurihara@cpan.org> LICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. MAINSEE ALSOHTTP::MobileAgent::DoCoMo, HTTP::MobileAgent::Vodafone, HTTP::MobileAgent::JPhone, HTTP::MobileAgent::EZweb, HTTP::MobileAgent::NonMobile, HTTP::MobileAgent::Display, HTTP::BrowserDetect Reference URL for specification is listed in Pods for each subclass.
|