Created
October 2, 2013 16:39
-
-
Save dc-nikolaev/6796613 to your computer and use it in GitHub Desktop.
Calculate Steam card drop remaining.
Work on page http://steamcommunity.com/id/*profile_name*/badges/
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 card_info_array = document.getElementsByClassName('progress_info_bold'); | |
var result = 0; | |
for (var iterator = 0; iterator < card_info_array.length; iterator++) { | |
var current_result_array = card_info_array[iterator].innerHTML.split(' '); | |
for (var item = 0; item < current_result_array.length; item++) { | |
if (!isNaN(parseInt(current_result_array[item]))) { | |
result+= +current_result_array[item]; | |
break; | |
} | |
} | |
} | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jQuery variant: