HTTP::MobileUID - 携帯端末の公式のユーザIDを取得する
use HTTP::MobileUID; use HTTP::MobileAgent; my $agent = HTTP::MobileAgent->new; my $userid = HTTP::MobileUID->new($agent); print $userid->uid;
携帯端末の公式のユーザIDを取得します。
キャリア公式のユーザIDを返します。
DoCoMoの場合はApache::DoCoMoUID互換の環境変数HTTP_X_DOCOMO_UIDから取得する実装になっています。
ユーザIDが取得できなかった場合は未定義値を返します。
コンバートしたユーザIDを返します。
DoCoMoの場合に先頭2文字削っているのと、Softbankの場合に先頭1文字削っているだけです。
基本このメソッドを使うことになると思います。
端末IDの取得には対応しているが何らかの理由でユーザIDが取得できないケースがあるのでそれを判定します。
no_uidが真になるのは以下のケース
DoCoMoでキャリア申請してない場合
SoftBankでユーザIDの通知設定を行わなかった場合
AUでサブスクライバIDの通知設定を行わなかった場合
ユーザIDとして正しいか判定します。
それぞれクラスメソッドとして用意しているので
if ( HTTP::MobileUID->is_docomo_uid($uid) ) {}
のような感じで使用することも可能です。
Ittetsu Miyazaki <ittetsu.miyazaki __at__ gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
HTTP::MobileAgent
To install HTTP::MobileUID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::MobileUID
CPAN shell
perl -MCPAN -e shell install HTTP::MobileUID
For more information on module installation, please visit the detailed CPAN module installation guide.