[Perl]ドコモのiメニュー検索のキーワードを取得する

add to hatena hatena.comment (0) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 0 2009 年 5 月 22 日 by: baron

ドコモ2009夏モデルのリファラー出力記念。
ドコモのiメニューで検索した時の検索キーワードを取得します。(たぶん)
$uriの値は実際はちょっと異なります。

PERL:
  1. use strict;
  2. use warnings;
  3. use Perl6::Say;
  4. use URI;
  5. use URI::Escape;
  6. use URI::Query;
  7.  
  8. my $uri = 'http://docomo.ne.jp/?key=%41%42%43';
  9.  
  10. my $query = URI->new($uri)->query;
  11. my $key = (URI::Query->new($query)->hash)->{key};
  12. say uri_unescape($key);

ドコモのドメインじゃなくてもkeyパラメータがあったらデコードしちゃいますが・・・

Leave a Reply

アナログ