text
stringlengths
0
173k
}else if($('div.goods-details-r').length !==0){
site="v5";
name = $('.goods-details-r .l:first em').text();
switch($('.crumbs a:last').attr('href')){
case "/dota2":
appid=570;
break;
case "/h1z1/kotk":
appid=433850;
break;
case "/csgo":
appid=730;
break
}
if(appid && name){
getItemUrl(appid,name);
}
}
}
function getItemUrl(appid,name){
GM_xmlhttpRequest({
method: "GET",
responseType: "json",
url: "https://steamcommunity.com/market/search/render/?count=1&q=&appid=" + appid + "&norender=1&query=" + name,
timeout:5000,
onload: function(res){
if(res&&res.response){
var response = res.response;
if(response.success && response.results.length > 0){
query("https://steamcommunity.com/market/listings/" + appid + "/" + response.results[0].hash_name);
}
}
}
});
}
function query(itemUrl){
GM_xmlhttpRequest({
method: "GET",
url: itemUrl,
timeout:5000,
onload: function(res){
if(res.status == "200" &&res.responseText!=="null"){
try{
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];
}
catch(err){
steamlogin();
return;
}
try{
var nameid = res.responseText.match(/Market_LoadOrderSpread\( (\d+)/)[1];
}
catch(err){
if(res.responseText.indexOf('market_listing_nav_container') != -1){
steamxj();
return;
}
}
GM_xmlhttpRequest({
timeout:5000,
method: "GET",
url: "https://steamcommunity.com/market/itemordershistogram?country=" + g_strCountryCode + "&language=" + g_strLanguage + "&currency=" + 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;
}
GM_addStyle(`.price > div{ margin-top:4px;font-size:16px; }
.ls, .hb {color:#e46409; }
.lsnf, .hbnf {color:#7ccc35; }
.lsr, .hbr {color:#1ee44a; }
.price > div > span{ text-align:center;display:-moz-inline-box; display:inline-block; width:90px;}
.title { font-size:14px; }
.title > strong:nth-child(1) { margin-left:80px; }
.title > strong:nth-child(2) { margin-left:60px; }
.afkout { float:left;width:280px; }
.afkout strong { color:#afb0b2;font-size: 15px}
`);
var $pinfo = $(`<div class="afkout">
<div class="title">
<strong>出售</strong><strong>求购</strong>
</div>
<div class="price">
<div><strong>价格:</strong><span class="ls"></span><span class="hb"></span></div>
<div><strong>税后:</strong><span class="lsnf"></span><span class="hbnf"></span></div>
<div><strong>比例:</strong><span class="lsr"></span><span class="hbr"></span></div>
</div></div>
`);