Created
October 2, 2013 17:29
-
-
Save dc-nikolaev/6797297 to your computer and use it in GitHub Desktop.
Calculate money on page https://store.steampowered.com/account/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result_rub = 0; | |
var result_dollar = 0; | |
var result_euro = 0; | |
jQuery('.transactionRowPrice').each(function() { | |
var string_value = $(this).innerText; | |
if (string_value.indexOf('pуб.')!=-1) { | |
result_rub+= +(string_value.split(' ')[0]).replace(',','.'); | |
} | |
if (string_value.indexOf('$')!=-1) { | |
result_dollar+= +string_value.replace('$','').replace('R','').replace(',','.'); | |
} | |
if (string_value.indexOf('€')!=-1) { | |
result_euro+= parseFloat(string_value.split(' ')[0]); | |
} | |
}); | |
console.log(result_rub + ' рублей'); | |
console.log(result_dollar + ' $'); | |
console.log(result_euro + ' €'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't kill me х__х
my jQuery variant: https://gist.github.com/Apa6eC/6799561