Steam货币转换:目前仅支持阿根廷比索换算人民币

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

当前为 2021-01-15 提交的版本,查看 最新版本

// ==UserScript==
// @name               Steam Currency Convert: Convert ARS to CNY only
// @name:zh-CN         Steam货币转换:目前仅支持阿根廷比索换算人民币
// @description        A simple way to make Steam Argentine user perceive the low prices. Convert ARS to CNY only,for now.
// @description:zh-cn  用简单粗暴的方式让Steam阿根廷区用户感受低价区的魅力,一遍遍汇率换算或者查SteamDB真的烦。目前仅支持阿根廷比索换算人民币。
// @version            0.8
// @author             无敌X哥 
// @namespace          SteamCurrencyConvert
// @match              https://store.steampowered.com/*
// @license            MIT License
// ==/UserScript==
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 / 13.1341).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 / 13.1341).toFixed(2)
        }
    }
}
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 / 13.1341).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 / 13.1341).toFixed(2)
        }
    }
}
var re = /(\D*)(\d\S*)/
var price = document.querySelectorAll('.StoreSalePriceBox')
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 / 13.1341).toFixed(2)
        }
    }
}