Skip to content

Instantly share code, notes, and snippets.

@KurohimeAkari
Last active November 3, 2015 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KurohimeAkari/76a5a9127fa795f1d961 to your computer and use it in GitHub Desktop.
Save KurohimeAkari/76a5a9127fa795f1d961 to your computer and use it in GitHub Desktop.
失敗作品:動くことには動く
// ==UserScript==
// @name niconico not clear tag
// @description タグ修正戦争が見てて(´・ω・`)な気持ちになるので
// @namespace http://shioneko.sakura.ne.jp/
// @version 1.1.0
// @include http://www.nicovideo.jp/watch/*
// @require http://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
// ページ移動反映処理ができない
$(function() {
//[ 非表示コンテンツ 一部一致でも消えるみたい]----------------//
var arycase = ["マリオメーカー問題","荒らし","タグ戦争"];
//------------------------------------------------------//
var categories = $(".videoHeaderTag .videoHeaderTagLink");
var tagUrl = "http://www.nicovideo.jp/tag/";
var wiki_f = '<div class="tagControlContainer"><div class="dic"><a href="http://dic.nicovideo.jp/a/';
var wiki_b = '"><span class="enable"></span></a></div></div>'
var num = false;
// 削除処理
$('.videoHeaderTag').remove();
$.each(
categories,
function(index, domEle) {
var ele = $(domEle);
var texts = $.trim(ele.text());
// arycaseから文字列処理:matchしたものだけ表示
//for (var i = 0; i < arycase.length; i++) {
for (var i = 0; i < arycase.length; i++) {
reg = new RegExp(arycase[i]);
if(texts.match(reg)){
num = true;
break
} else {
num = false;
}
};
if (num == false){
$('#videoHeaderTagList').append(num);
$('#videoHeaderTagList').append('<li class="videoHeaderTagLink"><a href="'+ tagUrl + texts +'" target="new">' + texts + '</a>'+ wiki_f + texts + wiki_b +'</li>');
}
});
// なんだか残る要素を削除する。
$('.videoHeaderTagLink:last-child').remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment