Changeset 33836
- Timestamp:
- 06/08/09 13:24:29 (4 years ago)
- Location:
- lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0
- Files:
-
- 1 added
- 6 modified
-
Changes (modified) (1 diff)
-
lib/HTTP/MobileAgent.pm (modified) (1 diff)
-
lib/HTTP/MobileAgent/DoCoMo.pm (modified) (5 diffs)
-
lib/HTTP/MobileAgent/EZweb.pm (modified) (1 diff)
-
lib/HTTP/MobileAgent/Vodafone.pm (modified) (1 diff)
-
t/12_guid.t (modified) (2 diffs)
-
t/13_imode_browser.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/Changes
r9288 r33836 1 1 Revision history for Perl extension HTTP::MobileAgent 2 3 0.28 Fri Jun 5 21:44:58 2009 4 * Added gps_compliant() method in DoCoMo.pm/EZweb.pm/Vodafone.pm(SoftBank). 5 * Added browser_version() method in DoCoMo.pm. 6 * $GPSModels and is_gps() method is obsolute but leave for backward compatibility in DoCoMo.pm. 7 * Fixed user_id() problem in Vodafone.pm(SoftBank). (Thanks to masutaro) 2 8 3 9 0.27 Fri Apr 11 13:34:23 2008 -
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/lib/HTTP/MobileAgent.pm
r9288 r33836 3 3 use strict; 4 4 use vars qw($VERSION); 5 $VERSION = '0.2 7';5 $VERSION = '0.28'; 6 6 7 7 use HTTP::MobileAgent::Request; -
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/lib/HTTP/MobileAgent/DoCoMo.pm
r9288 r33836 3 3 use strict; 4 4 use vars qw($VERSION); 5 $VERSION = 0. 19;5 $VERSION = 0.20; 6 6 7 7 use base qw(HTTP::MobileAgent); … … 15 15 16 16 # various preferences 17 use vars qw($DefaultCacheSize $HTMLVerMap $GPSModels );17 use vars qw($DefaultCacheSize $HTMLVerMap $GPSModels $GPSModelsRe); 18 18 $DefaultCacheSize = 5; 19 19 … … 28 28 qr/505i|506i|252i|253i|P213i|600i|700i|701i|800i|880i|SH851i|P851i|881i|900i|901i/ => '5.0', 29 29 qr/702i|D851iWM|902i/ => '6.0', 30 qr/70[34]i|(F|D|SH)705i|SH706ie|883i|801i|90[34]i|F05A/ => '7.0', 31 qr/(P|N|SO)705i|(N|SO|P|N)706i|884i|905i|N906iL|N03A|N05A|F07A/ => '7.1', 32 qr/(F|SH|P)706|906i|F0[12346]A|P0[123456]A|SH0[1234]A|N0[124]A/ => '7.2', 30 33 ]; 31 34 32 $GPSModels = { map { $_ => 1 } qw(F661i F505iGPS) }; 35 $GPSModels = { map { $_ => 1 } qw(F661i F505iGPS) }; # This value is obsolute, 36 # and will be removed in the near future. 37 $GPSModelsRe = qr/(?-xism:(?:F(?:8(?:8(?:4i(?:ES)?|3iES?S)|01i)|0[13569]A|505iGPS|661i)|S(?:A(?:70(?:0iS|2i)|800i)|H0[1234567]A)|(?:N0[12689]|P0[12789])A|90(?:3i(?!TV|X)|[4-6]i)))/; 33 38 34 39 sub is_docomo { 1 } … … 150 155 sub is_gps { 151 156 my $self = shift; 152 return exists $GPSModels->{$self->model}; 157 return $self->gps_compliant; 158 } 159 160 sub gps_compliant { 161 my $self = shift; 162 return $self->model =~ qr/$GPSModelsRe/; 153 163 } 154 164 … … 156 166 my $self = shift; 157 167 return $self->get_header( 'x-dcmguid' ); 168 } 169 170 sub browser_version { 171 my $self = shift; 172 return $self->is_foma && $self->cache_size >= 500 ? '2.0' : '1.0'; 158 173 } 159 174 -
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/lib/HTTP/MobileAgent/EZweb.pm
r9288 r33836 74 74 depth => 2 ** $depth, 75 75 ); 76 } 77 78 sub gps_compliant { 79 my $self = shift; 80 my @specs = split //, $ENV{ HTTP_X_UP_DEVCAP_MULTIMEDIA } || ''; 81 return defined $specs[ 1 ] && $specs[ 1 ] =~ /^[23]$/; 76 82 } 77 83 -
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/lib/HTTP/MobileAgent/Vodafone.pm
r9288 r33836 170 170 } 171 171 172 sub gps_compliant { 173 my $self = shift; 174 return $self->is_type_3gc; 175 } 176 172 177 sub user_id { 173 178 my $self = shift; 174 return $self->get_header( 'x-jphone-uid' ) unless $self->is_type_c; 179 return if $self->is_type_c; 180 return $self->get_header( 'x-jphone-uid' ); 175 181 } 176 182 -
lang/perl/HTTP-MobileAgent/branches/feature-imode-browser2.0/t/12_guid.t
r9288 r33836 19 19 my $ma = HTTP::MobileAgent->new( $header ); 20 20 my @keys = qw/carrier user_id/; 21 +{ map { $_ => $ma->$_ } @keys };21 +{ map { $_ => $ma->$_ || '' } @keys }; 22 22 } 23 23 … … 42 42 user_id: abcdef0123456789 43 43 44 === Vodafone 45 --- input 46 headers: 47 User-Agent: J-PHONE/2.0/J-DN02 48 X-JPHONE-UID: 49 --- expected 50 carrier: V 51 user_id: 52 44 53 === KDDI 45 54 --- input
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)