steam库质量净化

此页面https://steamcommunity.com/my/games/?tab=all查看库游戏的质量及快捷移除功能!(警告!)

当前为 2020-02-22 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         steam库质量净化
// @namespace    http://tampermonkey.net/
// @icon      	https://store.steampowered.com/favicon.ico
// @version      0.4
// @description  此页面https://steamcommunity.com/my/games/?tab=all查看库游戏的质量及快捷移除功能!(警告!)
// @author       wsz987
// @match        https://steamcommunity.com/id/*
// @match        https://steamcommunity.com/profiles/*
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @grant        GM_xmlhttpRequest
// @supportURL   https://keylol.com/suid-973554
// ==/UserScript==


(function() {
    'use strict';
    jQuery.support.cors = true;
    var i=0;
    for(i;i<$('.gameListRowItemName').length;i++){
        var id = $(".gameListRow")[i].getAttribute("id").replace(/game_/g, '');
        start(id,i);
    }
})();

function start(id,i){
    console.log(id,i);
    GM_xmlhttpRequest({
        method: "GET",
        url:"https://store.steampowered.com/app/"+id,
        onload:function(data){
            var quality;
            if(data.status == "200" &&data.responseText!=="null"){
                console.log('data',i,id,data);
                try{
                    quality=$(data.responseText).find('.game_review_summary')[0].outerText;
                }catch(e){
                    console.log(e);
                    quality="锁区/下架/未发售/测试版/暂无用户评价!";
                }
            }
            console.log(quality);
            var txt = document.createElement('div');
            txt.className = 'pullup_item';
            txt.id=id;
            txt.innerText=quality;
            if(quality=="褒贬不一"||quality=="褒貶不一"||quality=="Mixed"){
                txt.style.color="#B9A074";
            }else if(quality=="特别差评"||quality=="極度負評"||quality=="Very Negative"||quality=="多半差评"||quality=="大多負評"||quality=="Mostly Negative"){
                txt.style.color="#A34C25";
            }
            txt.onclick =function(){
                window.open("https://help.steampowered.com/zh-cn/wizard/HelpWithGameIssue/?appid="+id+"&issueid=123&transid=");
                console.log($(this).attr('id'));
            };
            $(".bottom_controls")[i].appendChild(txt);
            console.log(i,id,$('.gameListRowItemName').length-1);
        }
    });

};