root/HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent/AirHPhone.pm

Revision 890 (checked in by miyagawa, 17 years ago)

version 0.10

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 package HTTP::MobileAgent::AirHPhone;
2
3 use strict;
4 use vars qw($VERSION);
5 $VERSION = q(0.10);
6
7 use base qw(HTTP::MobileAgent);
8
9 __PACKAGE__->make_accessors(
10     qw(vendor model model_version browser_version cache_size)
11 );
12
13 sub is_airh_phone { 1 }
14
15 sub name { 'DDIPOCKET' }
16
17 sub parse {
18     my $self = shift;
19     my $ua = $self->user_agent;
20     $ua =~ m!^Mozilla/3\.0\(DDIPOCKET;(.*)\)CNF/2\.0$! or $self->no_match;
21     @{$self}{qw(vendor model model_version browser_version cache_size)} = split m!/!, $1;
22     $self->{cache_size} =~ s/^c//;
23 }
24
25 sub _make_display {
26     # XXX
27 }
28
29
30 1;
31 __END__
32
33 =head1 NAME
34
35 HTTP::MobileAgent::AirHPhone - Air H" Phone implementation
36
37 =head1 SYNOPSIS
38
39   use HTTP::MobileAgent;
40
41   local $ENV{HTTP_USER_AGENT} = "Mozilla/3.0(DDIPOCKET;JRC/AH-J3001V,AH-J3002V/1.0/0100/c50)CNF/2.0";
42   my $agent = HTTP::MobileAgent->new;
43
44   printf "Name: %s\n", $agent->name;            # DDIPOCKET
45   printf "Vendor: %s\n", $agent->vendor;        # JRC
46   printf "Model: %s\n", $agent->model;          # AH-J3001V,AH-J3002V
47   printf "Model Version: %s\n", $agent->model_version;  # 1.0
48   printf "Browser Version: %s\n", $agent->browser_version;      # 0100
49   printf "Cache Size: %s\n", $agent->cache_size; # 50
50
51 =head1 DESCRIPTION
52
53 HTTP::MobileAgent::AirHPhone is a subclass of HTTP::MobileAgent, which
54 implements DDIPocket's Air H" Phone user agents.
55
56 =head1 METHODS
57
58 See L<HTTP::MobileAgent/"METHODS"> for common methods. Here are
59 HTTP::MobileAgent::AirHPhone specific methods.
60
61 =over 4
62
63 =item vendor
64
65   $vendor = $agent->vendor;
66
67 returns vendor name.
68
69 =item model
70
71   $model = $agent->model;
72
73 returns model name. Note that model names are separated with ','.
74
75 =item model_version
76
77   $model_ver = $agent->model_version;
78
79 returns version number of the model.
80
81 =item browser_version
82
83   $browser_ver = $agent->browser_version;
84
85 returns versino number of the browser.
86
87 =item cache_size
88
89   $cache_size = $agent->cache_size;
90
91 returns cache size with kilobyte unit.
92
93 =back
94
95 =head1 AUTHOR
96
97 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>
98
99 This library is free software; you can redistribute it and/or modify
100 it under the same terms as Perl itself.
101
102 =head1 SEE ALSO
103
104 L<HTTP::MobileAgent>
105
106 http://www.ddipocket.co.jp/airh_phone/i_hp.html
107
108 =cut
Note: See TracBrowser for help on using the browser.