Skip to content

Instantly share code, notes, and snippets.

@dontangg
Last active June 8, 2020 22:29
Show Gist options
  • Save dontangg/ba27b5627297691f2889148b2dcb64c3 to your computer and use it in GitHub Desktop.
Save dontangg/ba27b5627297691f2889148b2dcb64c3 to your computer and use it in GitHub Desktop.
Unminified version of the gist
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