RSS 1.0 (RDF)��ǂݍ���

�@���̏͂ł́A�����̃T�C�g�Ŕz�M����Ă���RSS�𗘗p���Č��o���A�����N�A�L�����e�̗v���\�������Ă݂܂��B
RSS�Ɋւ��Ă͓ǂݍ��܂ꂽ���e�ɑ΂��Ĉꊇ���Č������Č��ʂ�\������Ƃ�����������Z�̘͂Z�ōs���܂����BRSS�Ɋւ��Ă��ډ�RSS�Ƃ����{������܂����A�T�C�g�Ō��������RSS�t�H�[�}�b�g�Ɋւ����񂪓����܂��B
�@�����RSS�Ƃ����Ă��ȒP�ł͂���܂���B�Ƃ����̂��t�H�[�}�b�g�������‚�����A���ꂼ��ʂ̒c�̂��쐬���Ă����肷�邽�߁A�݊����Ȃǂ��Ȃ������肵�܂��B���݁A�z�z����Ă���RSS�ɂ͈ȉ���3�‚�����܂��B

  1. RSS 1.0 (RDF)�@�y���{�ő������p�z
  2. RSS 2.0 (RSS 0.9x)�y�č��ő������p�z
  3. Atom�y�u���O�ő������p�z
�@RSS 0.9�����ǂ������̂�RSS 2.0�ł��B1.0�ł͂���܂���BRSS 1.0��RDF�t�H�[�}�b�g�ŕʌ‚ł��B�t�H�[�}�b�g�������������߁A�������悤�Ƃ������Ƃ�Atom���o�Ă��܂����B�u���O�ł�Atom�Ŕz�z����Ă���Ƃ��낪��������܂��B
�@�܂��A���̍��ł͓��{�ň�ԑ������p����Ă���RSS 1.0 (RDF) �̃f�[�^��\�������Ă݂܂��BRDF/XML�Ɋւ��Ă�Web KANZAKI���Q�l�ɂ��Ă݂Ă��������B

�@���̃T�C�g�̏��𓾂�ɂ�CGI��p�ӂ��Ă����K�v������܂��B���̏͂ł����p���܂������A�ȉ��̂悤��CGI�𗘗p���Ă��܂��B

#!/usr/local/bin/ruby
require "kconv"
require "cgi-lib"
input = CGI.new
inputdata = input["query"]
bom = "\xef\xbb\xbf"
print "Content-type: text/xml\n\n"
print bom
fh = open("| curl '"+inputdata+"'")
while !fh.eof
str = fh.gets
print Kconv::toutf8(str)
end
fh.close

�@��͂���RSS 1.0�ł����A�ȒP�ɏ����Έȉ��̂悤�ȍ\���ɂȂ��Ă��܂��B

<rdf:RDF>
�@<channel>
�@�@<title>�`</title>
�@�@<link>�`<link>
�@�@<description>�`<description>
�@</channel>
�@<item>
�@�@<title>�`</title>
�@�@<link>�`</link>
�@</item>
</rdf:RDF>

�@�Ԏ��̕���(item)���L���̐������J��Ԃ��L�q����܂��B����item�^�O���ɂ���title���L���̌��o���ɂȂ�܂��BRSS�f�[�^������getElementsByTagName("item")�Ƃ���item�^�O�̃��X�g���擾���A���̒��ɂ���title�^�O�̍ŏ��̃e�L�X�g�m�[�h��ǂݏo���܂��B����ŋL���̈ꗗ��\�������邱�Ƃ��ł��܂��B�i���ۂ̃X�N���v�g�����s�����j

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</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 rssSearch()
{
rssURL = $("siteURL").value;
httpObj = createXMLHttpRequest(displayData);
if (httpObj)
{
httpObj.open("GET","getrss.rb?query="+rssURL+"&cache="+(new Date()).getTime(),true);
httpObj.send(null);
}
}
function displayData()
{
if ((httpObj.readyState == 4) && (httpObj.status == 200))
{
parseRSS1(httpObj.responseXML);
}else{
$("result").innerHTML = "�ǂݍ��ݒ��ł�...";
}
}
// RSS 1.0 (RDF) ����͂��ă^�C�g���i���o���j�����\��
function parseRSS1(sXML)
{
var resultText = rssTitle = "";
var itemList = sXML.getElementsByTagName("item");
for (var i=0; i<itemList.length; i++)
{
rssTitle = itemList[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
resultText += rssTitle + "<br>";
}
$("result").innerHTML = resultText;
}
// --></script>
</head>
<body>
<h1>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</h1>
<form method="get" name="ajaxForm" onsubmit="rssSearch();return false;">
<select id="siteURL">
<option value="http://hotwired.goo.ne.jp/news/index.rdf">Wired</option>
<option value="http://japan.cnet.com/rss/index.rdf">CNET</option>
<option value="http://www3.asahi.com/rss/index.rdf">Asahi.com</option>
<option value="http://nikkeibp.jp/jp/flash/index.rdf">���oBP</option>
<option value="http://japan.zdnet.com/rss/news/index.rdf">ZDNET</option>
</select>
<input type="button" value="��������" onClick="rssSearch()">
</form>
<div id="result"></div>
</div>
</body>
</html>

�@����ŁA�ł�������Ƃ��������Ƃ���ł����A�Ȃ���Safari 2 (v203) �ł͓��삵�܂���B���̃u���E�U�ł͓��삷��̂�Safari 2�ɂ͉��炩�̕s�������悤�Ȋ����ł��B���̂��߁ASafari�ł����삳����ꍇ�ɂ́A��L�̂悤�Ɏ�y�ɏ������邱�Ƃ��ł��܂���B�ȉ��̂悤�Ƀm�[�h��H���Ă݂����L���𓾂���@���g�����ɂȂ�܂��B���̂悤�ɂ����Safari 2�ł����̃u���E�U�ł����삵�܂��B�i�T���v�������s�����j

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</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 rssSearch()
{
rssURL = $("siteURL").value;
httpObj = createXMLHttpRequest(displayData);
if (httpObj)
{
httpObj.open("GET","getrss.rb?query="+rssURL+"&cache="+(new Date()).getTime(),true);
httpObj.send(null);
}
}
function displayData()
{
if ((httpObj.readyState == 4) && (httpObj.status == 200))
{
parseRSS1(httpObj.responseXML);
}else{
$("result").innerHTML = "�ǂݍ��ݒ��ł�...";
}
}
// RSS 1.0 (RDF) ����͂��ă^�C�g���i���o���j�����\��
function parseRSS1(sXML)
{
var resultText = rssTitle = "";
var itemList = sXML.getElementsByTagName("item");
for (var i=0; i<itemList.length; i++)
{
rssTitle = itemList[i].childNodes[1].childNodes[0].nodeValue;
resultText += rssTitle + "<br>";
}
$("result").innerHTML = resultText;
}
// --></script>
</head>
<body>
<h1>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</h1>
<form method="get" name="ajaxForm" onsubmit="rssSearch();return false;">
<select id="siteURL">
<option value="http://hotwired.goo.ne.jp/news/index.rdf">Wired</option>
<option value="http://japan.cnet.com/rss/index.rdf">CNET</option>
<option value="http://www3.asahi.com/rss/index.rdf">Asahi.com</option>
<option value="http://nikkeibp.jp/jp/flash/index.rdf">���oBP</option>
<option value="http://japan.zdnet.com/rss/news/index.rdf">ZDNET</option>
</select>
<input type="button" value="��������" onClick="rssSearch()">
</form>
<div id="result"></div>
</div>
</body>
</html>

�@����͂P�s�����̏C���ōς݂܂������A���낢�돈�����Ă�����Safari 2���������܂������Ȃ��Ƃ������ۂ��������܂��B�����ŁA��4���܂ł�Safari�͏��O���邩���ʈ����Ƃ��ȉ��̂悤�Ƀu���E�U�𔻕ʂ��ď������s���܂��i�T���v�������s�����j�B�Ō�̍��ł�Safari 2�ł����̃u���E�U�ł����Ȃ����삷��X�N���v�g���쐬���܂��B

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<script type="text/javascript" src="xmlhttp.js"></script>
<script type="text/javascript"><!--
Safari = false;
if (navigator.userAgent.indexOf("Safari") > -1) Safari = true;
function rssSearch()
{
rssURL = $("siteURL").value;
httpObj = createXMLHttpRequest(displayData);
if (httpObj)
{
httpObj.open("GET","getrss.rb?query="+rssURL+"&cache="+(new Date()).getTime(),true);
httpObj.send(null);
}
}
function displayData()
{
if ((httpObj.readyState == 4) && (httpObj.status == 200))
{
parseRSS1(httpObj.responseXML);
}else{
$("result").innerHTML = "�ǂݍ��ݒ��ł�...";
}
}
// RSS 1.0 (RDF) ����͂��ă^�C�g���i���o���j�����\��
function parseRSS1(sXML)
{
var resultText = rssTitle = "";
var itemList = sXML.getElementsByTagName("item");
for (var i=0; i<itemList.length; i++)
{
if (Safari)
{
rssTitle = itemList[i].childNodes[1].childNodes[0].nodeValue;
}else{
rssTitle = itemList[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
}
resultText += rssTitle + "<br>";
}
$("result").innerHTML = resultText;
}
// --></script>
</head>
<body>
<h1>RSS��ǂݍ��݌��o����\������ (RSS 1.0 - RDF -)</h1>
<form method="get" name="ajaxForm" onsubmit="rssSearch();return false;">
<select id="siteURL">
<option value="http://hotwired.goo.ne.jp/news/index.rdf">Wired</option>
<option value="http://japan.cnet.com/rss/index.rdf">CNET</option>
<option value="http://www3.asahi.com/rss/index.rdf">Asahi.com</option>
<option value="http://nikkeibp.jp/jp/flash/index.rdf">���oBP</option>
<option value="http://japan.zdnet.com/rss/news/index.rdf">ZDNET</option>
</select>
<input type="button" value="��������" onClick="rssSearch()">
</form>
<div id="result"></div>
</div>
</body>
</html>

�@�����ł͋L���̈ꗗ��\�������ۂ̋L���Ƀ����N���Ă݂܂��B

[��11�́@2:RSS�̋L���Ɠ��e������������]
[�ڎ���]

(2006.1.29)