Greasy Fork is available in English.
快速查询Steam游戏信息
当前为
// ==UserScript==
// @name Steam Info
// @namespace http://userscripts.org/users/deparsoul
// @description 快速查询Steam游戏信息
// @include http://steamdb.sinaapp.com/sync
// @grant GM_xmlhttpRequest
// @version 0.34
// ==/UserScript==
if(document.URL == 'http://steamdb.sinaapp.com/sync'){
exec('setScriptVersion('+addslashes(GM_info.script.version)+')');
var nocache = '_='+Math.floor(Math.random()*100000);
load('http://steamcommunity.com/my/games?tab=all', 'own');
load('http://store.steampowered.com/dynamicstore/userdata/?'+nocache, 'userdata');
load('http://www.desura.com/games/ajax/json/all?collection=t&_='+Math.floor(Math.random()*100000), 'desura');
}else{
var script = document.createElement("script");
script.setAttribute("src", "http://steamdb.sinaapp.com/steam_info.js");
document.body.appendChild(script);
}
//Location hack
function exec(fn) {
location.assign(encodeURI("javascript:"+fn));
}
//Load url and call proc function
function load(url, id){
GM_xmlhttpRequest({
method: "GET",
url: url,
onload: function(response) {
exec('proc_'+id+'("'+addslashes(response.responseText)+'")');
}
});
}
//Add slashes to string
function addslashes(string) {
return string.replace(/\\/g, '\\\\').
replace(/\u0008/g, '\\b').
replace(/\t/g, '\\t').
replace(/\n/g, '\\n').
replace(/\f/g, '\\f').
replace(/\r/g, '\\r').
replace(/'/g, '\\\'').
replace(/"/g, '\\"');
}