Spoils posts based on keywords
当前为
// ==UserScript==
// @name Post Spoiler for mturkgrind.com
// @author Kerek
// @version 0.2
// @description Spoils posts based on keywords
// @require http://code.jquery.com/jquery-latest.min.js
// @include http://www.mturkgrind.com/*
// @copyright 2014+, You
// @namespace Kerek
// ==/UserScript==
var spoil_me = ["Example Keyword", "Second Example Keyword", "Third Example Keyword"];
var spoiler_text;
var spoiled = false;
$('[id^="post_message"]').each(function(){
spoiled = false;
for (i = 0; i < spoil_me.length; i++){
if ($(this).text().toLowerCase().indexOf(spoil_me[i].toLowerCase())!==-1){
spoiler_text = spoil_me[i] + " Spoiler";
spoiled = true;
}
}
if (spoiled)
{
var post_content = $(this).html();
$(this).html( '<div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;"><b>' + spoiler_text +':</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\';this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }" type="button"> </div> <div class="alt2" style="border: 1px inset ; margin: 0px; padding: 6px;"> <div style="display: none;">' + post_content + '</div> </div> </div>');
}
});
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址