// ==UserScript== // @name c5 extension // @namespace // @version 1.0 // @description 买买买 // @author out // @match *://www.c5game.com/* // @grant GM_xmlhttpRequest // @grant GM_addStyle // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @connect steamcommunity.com // @namespace out // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... $(document).ready(function(){ GM_addStyle(".price > div{margin:5px 0px;font-size:14px;}" +".price > div:nth-child(1) span{color:#e46409;}" +".price > div:nth-child(2) span{color:#7ccc35;}" +".price > div:nth-child(3) span{color:#1ee44a;}" +".price > div > span{ text-align:center;display:-moz-inline-box; display:inline-block; width:80px;}" +".sb{font-size:14px;}" +".sb > strong:nth-child(1){margin-left:70px;}" +".sb > strong:nth-child(2){margin-left:50px;}" ); if($(".right_steam").length!==0){ var href = $(".right_steam a").attr("href"); GM_xmlhttpRequest({ method: "GET", url: href, timeout:5000, onload: function(res){ if(res.status == "200" &&res.responseText!=="null"){ var g_sessionID = res.responseText.match(/g_sessionID = "([^"]+)"/)[1]; var g_walletCurrency = parseInt(res.responseText.match(/"wallet_currency":(\d+)/)[1]); var g_strLanguage = res.responseText.match(/g_strLanguage = "([^"]+)"/)[1]; var g_strCountryCode = res.responseText.match(/g_strCountryCode = "([^"]+)"/)[1]; var nameid = res.responseText.match(/Market_LoadOrderSpread\( (\d+)/)[1]; if(!nameid) return; GM_xmlhttpRequest({ timeout:5000, method: "GET", url: "https://steamcommunity.com/market/itemordershistogram?country=" + g_strCountryCode + "&language=" + g_strLanguage + "¤cy=" + g_walletCurrency + "&item_nameid=" + nameid, responseType: "json", onload: function(data){ var obj = data.response; if(obj){ if(!obj.lowest_sell_order&&!obj.highest_buy_order) return; $("div.hero > span:first").hide(); $("div.hero > div.right_steam").css("float","none"); var $pinfo = $("