Kongregate LinkTester

Tests links against a checklist

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);";