Last active
June 8, 2020 22:29
-
-
Save dontangg/ba27b5627297691f2889148b2dcb64c3 to your computer and use it in GitHub Desktop.
Unminified version of the gist
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 csv = $('.gl-gear-needed__ingredient-header-primary').map((i, gearDiv) => { | |
var gearName = $(gearDiv).find('.gl-gear-needed__ingredient-header-name').text(); | |
var gearRemainingText = $(gearDiv).find('.gl-gear-needed__progress').attr('title'); | |
var matchResult = gearRemainingText.match(/(\d+) of (\d+)/); | |
var assignedCount = matchResult[1]; | |
var totalCount = matchResult[2]; | |
return gearName + ',' + totalCount + ',' + assignedCount; | |
}).toArray().join('\n'); | |
csv = "Name,Total,Assigned,Hoarded\n" + csv; | |
window.download(csv, "GLGearNeeded.csv", "text/csv"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment