Created
October 19, 2018 23:13
-
-
Save hushin/891fe48218c9c7c5402598ea71a5b3b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ニコレポを見やすくするやつ | |
// @namespace https://twitter.com/hush_in | |
// @version 0.1 | |
// @description ニコレポを見やすくするやつ | |
// @author hush_in | |
// @match https://www.nicovideo.jp/my/top | |
// @grant none | |
// ==/UserScript== | |
{ | |
const $ = jQuery | |
$(() => { | |
setTimeout(() => { | |
const main = () => { | |
$('.NicorepoTimelineItem').each((i, elm) => { | |
const $elm = $(elm) | |
const logText = $elm.find('.log-body').text() | |
const ignorePattern = /再生を達成しました|動画を登録しました|ランキングで|生放送を開始しました|生放送を予約しました。/ | |
if (ignorePattern.test(logText)) $elm.remove() | |
}) | |
} | |
main() | |
const observer = new MutationObserver((mutations) => { | |
main() | |
}) | |
const config = { | |
childList: true | |
} | |
observer.observe($('.NicorepoTimeline').get(0), config) | |
}, 1500) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment