// ==UserScript== // @name Nico Nickname // @namespace http://web.zgo.jp/ // @description うp主のニックネームを調べるスクリプト http://script41self.seesaa.net/さんで公開されているものを勝手に改造したものです。 // @include http://www.nicovideo.jp/watch/* // @updated 2008-02-18 19:45:00 // ==/UserScript== (function(){ var video_id = location.href.match(/watch\/[sn]m(\d+)/)[1]; var h1 = document.getElementsByTagName('h1')[0]; if(!h1) return; // smilevideo link var svlink = 'http://www.smilevideo.jp/allegation/allegation/'+ video_id+'/'; //alert(svlink); GM_xmlhttpRequest({ method: 'GET', url: svlink, headers: { "User-Agent": "Mozilla/5.0" }, onload: function(res){ var nickname = 'no name'; // can't get nickname if(/]*|)>(.*?)<\/strong>.*?が投稿/.test(res.responseText)) { nickname = decodeURIComponent(RegExp.$1); } var span = document.createElement('span'); //p.setAttribute('class', 'TXT12'); span.style.cssText = 'font-size:small; margin-top:4px; line-height:1.25;'; //cssのスタイルを変える。 span.innerHTML = ' うp主:' + nickname + ''; h1.insertBefore(span, h1.nextChild); // insert position }, //nextをfirstにするとタイトル前に表示 onerror: function(res){ GM_log(res.status + ':' + res.statusText); } }); })();