08/10/10 14:04:22 1OhXj85a0
ちょっと書いてみた(IE用)
<html><head><title>米いらない人向け</title><script>
var interval_sec=5;//監視間隔(秒)
function getFlv(id){
setTimer = function(){setTimeout("getFlv('"+id+"')",interval_sec*1000);}
getInfo = function(t){p={};a=t.split("&");for(i=0;i<a.length;i++){d=a[i].split("=");p[d[0]]=decodeURIComponent(d[1]);}return p;}
getData = function(url) {
var httpo = new ActiveXObject("Microsoft.XMLHTTP");
httpo.open("GET",url,false);
httpo.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
httpo.send(null);
return (httpo.status==200)?httpo.responseText:"";
}
document.body.innerText=id+" 監視中 "+(new Date());
var check = getData("URLリンク(www.nicovideo.jp)"+id);
if(check.indexOf("NOT_FOUND")>=0){setTimer();return;}
if(check.indexOf("DELETED")>=0){document.body.innerText="あぼーん";return;}
var data = getData("URLリンク(www.nicovideo.jp)"+id);
if(data==""){setTimer();return;}
if(getData("URLリンク(www.nicovideo.jp)"+id)==""){setTimer();return;}
document.body.innerText=id+"キタ――(゚∀゚)――!!!\n\n"+check;
location.href = getInfo(data).url;
}
</script></head><body>
ID<input type=text id=id value="sm"><input type=button value="GO" onclick="javascript:getFlv(document.getElementById('id').value);">
</body></html>