Infoseek�������ʂ�\������

�@Infoseek��Yahoo��goo�Ɠ������@�ŗ��p���邱�Ƃ��ł��܂��B�قȂ�̂�CGI���ŌĂяo��Infoseek��URL�����݂̂ɂȂ�܂��B�i�T���v�������s�����j

#!/usr/local/bin/ruby
require "kconv"
require "cgi-lib"
input = CGI.new
inputdata = input["query"]
bom = "\xef\xbb\xbf"
print "Content-type: text/html\n\n"
print bom
fh = open("| curl 'http://www.infoseek.co.jp/OTitles?lk=noframes&qp=0&st=0&nh=10&col=OW&svp=SEEK&svx=100600&qt="+inputdata+"'")
while !fh.eof
str = fh.gets
print Kconv::toutf8(str)
end
fh.close

�@Infoseek��Yahoo��Google�Ɣ�ׂČ������ʂ��\�������̂��x�����߁A�{���ɃX�N���v�g�����삵�Ă��邩�ǂ����s���ɂȂ�܂��B���̂悤�ȏ������x���x���A�҂����Ԃ���������ꍇ�ɂ́A�󋵂������v���O���X�o�[�i�i�s�󋵂������O���t�j��\������悤�ɂ��܂��B�v���O���X�o�[�̕\���́A���炩����div�^�O�Ń��b�Z�[�W����p�ӂ��Ă����A�X�^�C���V�[�g�Ŕ�\���ɂ��Ă����܂��B�������J�n���ꂽ��A��\���ɂȂ��Ă����v���O���X�o�[��\�������܂��B�������I��������A�v���O���X�o�[���\���ɂ���΂ł�������ł��B�i�T���v�������s�����j

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Infoseek�������ʂ��}���`�E�B���h�E�ŕ\������</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<script type="text/javascript" src="xmlhttp.js"></script>
<script type="text/javascript"><!--
function InfoseekSearch()
{
srchStr = document.getElementById("query").value;
if (srchStr == "") return;
srchStr = srchStr.replace(/ /g,"%20");
httpObj = createXMLHttpRequest(displayData);
if (httpObj)
{
httpObj.open("GET","curl.rb?query="+encodeURI(srchStr)+"&cache="+(new Date()).getTime(),true);
$("progress").style.visibility = "visible";
httpObj.send(null);
}
}
function displayData()
{
if ((httpObj.readyState == 4) && (httpObj.status == 200))
{
newWindow();
$("result"+ winNum).innerHTML = httpObj.responseText;
winNum++;
}
}
function newWindow()
{
$("progress").style.visibility = "hidden";
var dObj = $("window0").cloneNode(true);
var winObj = $("contents").appendChild(dObj);
winObj.id = "window"+winNum;
winObj.childNodes[0].id = "result"+winNum;
addEvent("window"+winNum,"click",closeWindow,false);
addEvent("window"+winNum,"mousedown",dragObj.dragStart,false);
winObj.style.left = 10+Math.floor(Math.random()*400)+"px";
winObj.style.top = 150+Math.floor(Math.random()*200)+"px";
winObj.style.visibility ="visible";
winObj.style.zIndex = dragObj.zIndex + 1;
winObj.childNodes[0].style.visibility = "visible";
dragObj.window.push("window"+winNum);
dragObj.maxLayer = dragObj.window.length;
}
// �E�B���h�E��‚��鏈��
function closeWindow(e)
{
// �N���[�Y�{�b�N�X��Ń}�E�X�{�^���������ꂽ���H
if ((dragObj.offsetX < 2) || (dragObj.offsetX >14) || (dragObj.offsetY < 4) || (dragObj.offsetY > 16)) return;
wObj = getEventTarget(e);
contObj = $("contents");
// �E�B���h�E���m�[�h����폜
for (var i=0; i<contObj.childNodes.length; i++)
{
if(contObj.childNodes[i].id == wObj.id) contObj.removeChild(contObj.childNodes[i]);
}
// �E�B���h�E���X�g����폜
var temp = new Array();
for (i=0; i<dragObj.window.length; i++)
{
if (dragObj.window[i] != wObj.id) temp.push(dragObj.window[i]);
}
dragObj.window = temp;
}
function initObj()
{
window.document.onmousemove = dragObj.dragProc;
window.document.onmouseup = dragObj.dragEnd;
winNum = 1;
dragObj.window = [];
dragObj.maxLayer = 1; // �ő僌�C���[����
}
// --></script>
</head>
<body onload="initObj()" oncontextmenu="return false">
<h1>Infoseek�������ʂ��}���`�E�B���h�E�ŕ\������</h1>
<p>�ǂݍ��ݒ��̓v���O���X�o�[�i�i�s�󋵕\���j���\������܂�</p>
<form method="get" name="ajaxForm" onsubmit="InfoseekSearch();return false;">
<input type="text" value="" id="query">
<input type="button" value="Infoseek����" onClick="InfoseekSearch()">
</form>
<div id="contents"></div>
<div id="window0" class="windowBorder"><div id="result0" class="windowContents"></div>
</div>
<div id="progress"><img src="ring.gif"> �������ʂ�ǂݍ��ݒ��ł�...</div>
</body>
</html>

�@�����ł͊y�V�s��̌������ʂ�\�������Ă݂܂��B

[��Z�́@4:�y�V�s��̌������ʂ�\��������]
[�ڎ���]

(2006.1.19)