#!/usr/local/bin/perl $| = 1; ###################################################################### # # Whois ドメイン情報取得 # URL http://www.kiyoproject.com/ ; $rcsid = q$Id: whois.cgi,v 0.1.4 2006/04/18 11:09:00 kiyo Exp $; # ###################################################################### # # Copyright (c) 2002-2006 Kiyoteru Onishi # Copyright (c) 2002-2006 KIYO Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # 3. The name of the author may not be used to endorse or promote # products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # ■ファイル配置 # public_html -- cgi-bin # | # |-- whois # | | # | |-- whois.cgi # | # |-- lib # | # |-- Net # | | # | |-- Whois # | | # | |-- Raw.pm # | Raw # | | # | |-- Data.pm # | # |-- jcode.pl # |-- plibs.pl # # ■パーミッション # ---------------------------------------------------------------- # ファイル名 アクセス権 # ---------------------------------------------------------------- # whois 755(ディレクトリ) # lib 755(ディレクトリ) # Net 755(ディレクトリ) # Whois 755(ディレクトリ) # Raw 755(ディレクトリ) # whois.cgi 755(プログラム) # Raw.pm 644(モジュール) # Data.pm 644(モジュール) # jcode.pl 644(ライブラリ) # plibs.pl 644(ライブラリ) # ---------------------------------------------------------------- # ###################################################################### ############## # 環境設定 # ############## use lib qw(../lib); use Net::Whois::Raw; require 'jcode.pl'; require 'plibs.pl'; $script = $0; $script =~ s/(.*)\/([a-zA-Z0-9_\%\.])$/$2/; $title = 'Whois'; # タイトル $charset = 'Shift_JIS'; # 文字コード設定 $bground = ''; # 壁紙 $bgcolor = '#000000'; # 背景色 $text = '#ffffff'; # 文字色 $link = '#ffffff'; # 未読リンク色 $vlink = '#ff0000'; # 既読リンク色 $alink = '#ff0000'; # リンククリック時色 ############## # 設定終了 # ############## $version = $rcsid =~ /,v ([\d.]+)/ ? $1 : 'unkown'; $hr = '
'; # 携帯電話からのアクセスかをチェック $ketai = plibs::ketaiax(); # フォームデータのデコード plibs::decode(\%form); $dom = $form{'dom'}; # ドメイン名が入力されていれば情報を取得 if($dom) { $s = whois($dom); jcode::convert(\$s, 'sjis'); # 文字列をシフトJISに変換 plibs::tobr(\$s); # 改行を
タグに変換 if ($ketai) { $s = "$hr
".$s."
$hr"; } else { $s = '

'.$s.'

'; } } else { if ($ketai) { $s = "$hr"; } else { $s = '
'; } } ################## # HTML上部分表示 # ################## plibs::header($title, $charset); print qq|\n|; if ($ketai) { print qq|
$title Ver.$version
\n|; print "$hr\n"; } else { print qq|
$title Ver.$version
\n|; print "
\n"; } ################ # HTML内容表示 # ################ print qq|
\n|; if ($ketai == 1) { # i-modeアクセス print qq|ドメイン名

\n|; } elsif ($ketai == 2) { # J-SKYアクセス print qq|ドメイン名

\n|; } else { # PCアクセス print qq|ドメイン名 : \n|; } print <<"EOD";
$s
EOD ################## # HTML下部分表示 # ################## if ($ketai) { # 著作権表示 <削除改変禁止> print qq|Copyright(C)
2002-2006
\n|; print qq|KIYO Project\n|; } else { # 著作権表示 <削除改変禁止> print qq|Copyright (C) 2002-2006 KIYO Project\n|; } print "

\n"; plibs::end_html();