// ==UserScript== // @name niconico myvideo search // @namespace http://web.zgo.jp/ // @description 投稿動画から作者のMyvideoを探す // @include http://www.nicovideo.jp/watch/* // ==/UserScript== (function(){ const videoId = unsafeWindow.Video.id; var h1 = document.getElementsByTagName('h1')[0]; if(!h1) return; GM_xmlhttpRequest({ method: 'GET', url: 'http://www.nicovideo.jp/ranking_graph/mylist/daily/all/' + videoId, headers: { "User-Agent": "Mozilla/5.0" }, onload: function(res) { if(res.status==200){ var userVideoId = res.responseText.match(/\bmyvideo\/([0-9]+)/); //window.gm_nicoUserId = userVideoId[1]; var span = document.createElement('span'); span.style.cssText = 'font-size:small; margin-top:4px; line-height:1.25;'; span.innerHTML = ' 公開投稿動画'; h1.insertBefore(span, h1.nextChild); // insert position }else{ GM_log(res.status + ':' + res.statusText); } }, onerror: function(res){ GM_log(res.status + ':' + res.statusText); } }); })();