您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
tiao zhan G fat
当前为
// ==UserScript== // @name c5 extension // @namespace out // @version 0.1 // @description tiao zhan G fat // @author out // @match *://www.c5game.com/* // @grant GM_xmlhttpRequest // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @connect steamcommunity.com // ==/UserScript== (function() { 'use strict'; // Your code here... $(document).ready(function(){ if($(".right_steam").length!==0){ var hash_name = $(".right_steam a").attr("href").slice(47); GM_xmlhttpRequest({ method: "GET", url: "http://steamcommunity.com/market/priceoverview/?currency=23&appid=730&market_hash_name="+hash_name, onload: addprice }); } function addprice(res){ if(res.responseText!=="null"){ var d = JSON.parse(res.responseText); console.log(res.responseText); if(d.success){ var steam_price = getFloat(d.lowest_price); var text = "Steam参考价:"+d.lowest_price+" 税后:"+(steam_price/1.15).toFixed(2); if($(".sale-item-lists span.ft-orange").lenght!==0){ var c5_price=getFloat($(".sale-item-lists span.ft-orange:first").text()); text += "("+(c5_price*1.15/steam_price).toFixed(1)+"折)"; } $(".right_steam a").text(text); } } } function getFloat(str){ var xs = str.length-str.indexOf("."); console.log(xs); console.log(str); return parseFloat(str.replace(/[^0-9]/ig,"")); } }); })();