Kongregate LinkTester

Tests links against a checklist

当前为 2016-03-06 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name Kongregate LinkTester
// @description Tests links against a checklist
// @include http://www.kongregatestage.com/games/*
// @author Zaphio
// @version 7
// @date 10/07/10
// @namespace https://greasyfork.org/users/32649
// ==/UserScript==
var googleAPI=document.createElement("script");googleAPI.setAttribute("type","text/javascript");googleAPI.setAttribute("src","http://www.google.com/jsapi");document.body.appendChild(googleAPI);window.location.href="javascript:("+
function(){var url="http://spreadsheets.google.com/tq?tqx=out:json&tq=select%20*&key=0Aq9gclOUtmuudE5iZUZBNXc1ZjFDMjhYdzZQTDQ4LVE";var blacklist={};var whitelist=[];function sendQueryCallback(response){if(response.isError()){console.log("Error in query: "+response.getMessage()+": "+response.getDetailedMessage());return;}
console.log("Query succesfull, attaching to holodeck.");var dt=response.getDataTable();whitelist=dt.getDistinctValues(1);for(var i=2,len=dt.getNumberOfColumns();i<len;i++){blacklist[dt.getColumnLabel(i)]=dt.getDistinctValues(i);}
window.holodeck._event_dispatcher.register('room_message',function(event){var message=event.data.message.toLowerCase();function showMsg(msg){window.holodeck._active_dialogue.displayMessage('LinkTester',msg,{'class':'whisper received_whisper'},{'non_user':true});}
function findStr(arr,str){return arr.find(function(e){if(!e){return false;}
return str.include(e);});}
for(var a in blacklist){console.log("Testing category: "+a);var mat=findStr(blacklist[a],message);if(mat!==undefined){if(findStr(whitelist,message)!==undefined){console.log("Whitelisted, ignoring.");return;}else{showMsg("WARNING: Malicious link detected! (match: "+mat+", type: "+a+").");}}}});}
function loadPackageCallback(){if(google.visualization.Query!==undefined){console.log("Visualization package loaded.");var query=new google.visualization.Query(url);query.send(sendQueryCallback);console.log("Query sent.");}else{window.setTimeout(function(){loadPackageCallback();},250);}}
window.setTimeout(function(){console.log("Loading visualization package.");google.load("visualization","1",{"packages":["table"],"callback":loadPackageCallback});},1000);}+")();void(0);";