Skip to content

Instantly share code, notes, and snippets.

@supermomonga
Forked from raa0121/lingr_nicovide.user.js
Last active December 15, 2015 14:49
Show Gist options
  • Save supermomonga/5277251 to your computer and use it in GitHub Desktop.
Save supermomonga/5277251 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name lingr_nicovideo
// @namespace raa0121 & supermomonga
// @description lingr_nicovideo
// @include http://lingr.com/*
// @version 1
// ==/UserScript==
$(function(){
setInterval(function(){
$('.speaker[href="/bot/nicothumb"]').each(function(){$(this).parent().css('display','none')});
$('.decorated a').each(function(){
if($.isArray(this.href.match(/^http:\/\/(www.|live.)?nico(.ms|video.jp\/watch\/)(sm|nm|lv)?(\d+)\??/))){
embedurl = ( RegExp.$3 == 'lv' ? 'http://live.nicovideo.jp/embed/' : 'http://ext.nicovideo.jp/thumb/' ) + RegExp.$3 + RegExp.$4;
$(this).replaceWith('<iframe style="width: 312px;height: 176px; border: 1px solid #333;" frameborder="0" scrolling="no" src="' + embedurl + '"></iframe>');
}
});
},1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment