【ニコニコ】とりし○part1

このエントリーをはてなブックマークに追加
52とりあえず修正版ね
デフォじゃない点は、nがtrue、更新は5秒毎、顔の横に番号表示

<html><!-- IE5.5以上で動作するはずです。ソースが汚いのは仕様です -->
<head><title>とりし○</title>
<script type="text/javascript">
/* 設定 */
var n = true//←ここをtrueにすると、キター時に自動で動画ページに飛びます
var z = false//←ここをtrueにすると、キター時にピロンします
s="(´・ω・`)";if(!location.search.match(/\?v=(..\d+)/)){var t=prompt("動画IDを入力","sm");
if(t)location.href="?v="+t;else document.write(s)}else{a=RegExp.$1;var b=setInterval(chk,5000);document.title="待機中:"+a;}
k="キタ━━━━(゚∀゚)━━━━!!";
function kita(a){document.title=(document.title==k)?a:k}
function out(c){document.body.innerHTML="<a href=\"javascript:sai()\">対象:"+a+"</a><br>"+c}
function sai(){var u=prompt("動画IDを入力",a);if(u)location.href="?v="+u}
function chk(){
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ;
xmlhttp.open("GET","http://www.nicovideo.jp/api/getthumbinfo/" + a , false)
xmlhttp.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
xmlhttp.send(null)
if(xmlhttp.readyState==4){
var xml = xmlhttp.responseXML
var getValue=function (tagName){return xml.getElementsByTagName(tagName)[0].firstChild.nodeValue}
var getInfo=function(ary){var e="";for(var i=0;i<ary.length;i++) e+= "<tr><td>"+ary[i]+"<td>"+getValue(ary[i]);return e}
if(xml.getElementsByTagName("nicovideo_thumb_response")[0].getAttribute("status")=="ok"){
clearInterval(b);if(z)alert(k);
if(n){location.href=getValue('watch_url')}else{setInterval(function(){kita(getValue("title")+"("+getValue("video_id")+")")},500)}
var info = getInfo(["title","first_retrieve","length","video_id","description"])
out("<iframe src='http://ext.nicovideo.jp/thumb/"+getValue('video_id')+"' width=312 height=176></iframe><br><table border=1>"+info+"</table>")
}else{if(getValue("code")=="DELETED"){out(" "+a+" 削除済みです…"+s);clearInterval(b);
}else{out(s+" "+a+" "+"待機中"+new Date());}}}}
</script>
</head>
</html>