steam库质量净化

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         steam库质量净化
// @namespace    http://tampermonkey.net/
// @icon      	https://store.steampowered.com/favicon.ico
// @version      0.6
// @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, '');
        setTimeout(start(id,i),50);
    }
})();

function start(id,i){
    //console.log(id,i);
    GM_xmlhttpRequest({
        method: "GET",
        responseType: "json",
        url:"https://store.steampowered.com/appreviews/"+id+"?json=1&language=all&review_type=all&purchase_type=all",
        onload:function(data){
            var quality,count="";
            console.log('data',i,id,data.response.success,data);
            if(data.status == "200" &&data.responseText!=="null"){
                if(data.response.success==1){
                    console.log(data.response.query_summary.review_score_desc);
                    quality=data.response.query_summary.review_score_desc;
                    if(data.response.query_summary.total_reviews!=0){
                        count="("+data.response.query_summary.total_reviews+")"
                    }
                }else{
                    quality="下架/测试版";
                }
            }
            var txt = document.createElement('div');
            txt.className = 'pullup_item';
            txt.id=id;
                txt.innerText=quality+count;
            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);
        }
    });
};