// ==UserScript== // @name c5 extension // @namespace // @version 0.4 // @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;width:100px;font-size:14px;}" +".price span{float:right;}" +".price > div:nth-child(1) span{color:#e46409;}" +".price > div:nth-child(2) span{color:#7ccc35;}" +".price > div:nth-child(3) span{color:#1ee44a;}" ); if($(".right_steam").length!==0){ var href = $(".right_steam a").attr("href"); var match = href.match(/\/steamcommunity\.com\/market\/listings\/([0-9]+)\//); var hash_name = href.slice(match[1].length+44); var appid = match[1]; GM_xmlhttpRequest({ method: "GET", url: "http://steamcommunity.com/market/priceoverview/?currency=23&appid="+appid+"&market_hash_name="+hash_name, onload: addprice }); } function addprice(res){ if(res.responseText!=="null"){ var d = JSON.parse(res.responseText); if(d.success){ $("div.hero > span:first").hide(); $("div.hero > div.right_steam").css("float","none"); var steam_price = getFloat(d.lowest_price); var $pinfo = $("