Steam Currency Convert: Convert ARS to CNY only

A simple way to make Steam Argentine user perceive the low prices. Convert ARS to CNY only,for now.

目前為 2021-05-13 提交的版本,檢視 最新版本

// ==UserScript==
// @name               Steam Currency Convert: Convert ARS to CNY only
// @name:zh            Steam货币转换:目前仅支持阿根廷比索换算人民币
// @description        A simple way to make Steam Argentine user perceive the low prices. Convert ARS to CNY only,for now.
// @description:zh     用简单粗暴的方式让Steam阿根廷区用户感受低价区的魅力,一遍遍汇率换算或者查SteamDB真的烦。目前仅支持阿根廷比索换算人民币。
// @version            0.9999
// @author             无敌X哥 
// @namespace          SteamCurrencyConvert
// @match              https://store.steampowered.com/*
// @license            MIT License
// ==/UserScript==
let er = 14.57
//-----折扣换算-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.discount_final_price')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----原价换算-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.game_purchase_price')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----DLC价格-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.game_area_dlc_price')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----忘记了这是啥-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.global_action_link')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----特卖换算(部分)-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.salepreviewwidgets_StoreSalePriceBox_3j4dI')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----购物车列表-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.cart_estimated_total')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----购物车总额-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.price')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}
//-----愿望单-----
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.discount_price .discount_final_price')
for(ind in price){
    if(re.test(price[ind].textContent)){
        var matchItem = re.exec(price[ind].textContent)
        if(matchItem[1].indexOf('ARS') >= 0){
            let p = matchItem[2].replace('.','').replace(',','.')
            price[ind].textContent = '¥' + (p / er).toFixed(2)
        }
    }
}