HTTP::MobileAttribute::Plugin::Display - ディスプレイサイズの情報を得る
use HTTP::MobileAttribute plugins => [ { module => 'Display', config => { DoCoMoMap => +{ D209I => +{ color => 1 depth => 256 height => 90 width => 96 }, # snip ... } } }]; HTTP::MobileAttribute->new($ua)->display; # => instance of HTTP::MobileAttribute::Plugin::Display::Display
'display' メソッドを呼ぶと、HTTP::MobileAttribute::Plugin::Display::Display のインスタンスをえることができます。 このオブジェクトは width, height, color, depth の 4 種類の属性をもっています。
DoCoMo は、HTTP Header 等からこの情報をうけとることができないので、データをプラグインにわたす必要があります。 この情報は、 DoCoMo からマシンリーダブルな形式では提供されていないので WWW::MobileCarrierJP 等を駆使してスクレイピングする必要があります。
これを行うスクリプトは tools/make-docomo-display-map.pl として同梱してあります。
Tokuhiro Matsuno
HTTP::MobileAttribute
To install HTTP::MobileAttribute, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::MobileAttribute
CPAN shell
perl -MCPAN -e shell install HTTP::MobileAttribute
For more information on module installation, please visit the detailed CPAN module installation guide.